Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow phone to set time for fixed positions #3403

Merged
merged 1 commit into from
Mar 14, 2024
Merged

Conversation

thebentern
Copy link
Contributor

Fixed position functionality appears to have been well safeguarded in the GPS classes but not in the position module itself and was taking any position packet from the phone and applying it locally. This PR should resolve that and only allow the phone to modify the time, which is desirable.

Before fix:

INFO  | 20:35:30 98 [Router] Received position from=0x0, id=0x45736e49, portnum=3, payloadlen=25
DEBUG | 20:35:30 98 [Router] Incoming update from MYSELF
DEBUG | 20:35:30 98 [Router] Setting local position: latitude=3XXXXXXXXX, longitude=-9XXXXXXXXX, time=1710362131
INFO  | 20:35:30 98 [Router] POSITION node=fa8165a4 l=25 latI=3XXXXXXXXX lonI=-9XXXXXXXXX msl=107 hae=0 geo=0 pdop=0 hdop=0 vdop=0 siv=10 fxq=0 fxt=0 pts=1710362131 time=1710362131
INFO  | 20:35:30 98 [Router] From Radio onread
INFO  | 20:35:30 98 [Router] updatePosition REMOTE node=0xfa8165a4 time=1710362131, latI=3XXXXXXXXX, lonI=-9XXXXXXXXX
INFO  | 20:35:30 98 [Router] getFromRadio=STATE_SEND_PACKETS

After fix:

INFO  | ??:??:?? 11 [Router] Received position from=0x0, id=0x4d5e2909, portnum=3, payloadlen=25
DEBUG | ??:??:?? 11 [Router] Ignore incoming position update from myself except for time, because position.fixed_position is true
DEBUG | ??:??:?? 11 [Router] Setting local position time only: time=1710362463
DEBUG | ??:??:?? 11 [Router] Module 'position' considered
INFO  | ??:??:?? 11 [Router] From Radio onread
DEBUG | ??:??:?? 11 [Router] Module 'routing' wantsPacket=1
INFO  | ??:??:?? 11 [Router] Received routing from=0x0, id=0x4d5e2909, portnum=3, payloadlen=25
INFO  | ??:??:?? 11 [Router] getFromRadio=STATE_SEND_PACKETS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant