paulmandal / atak-forwarder

Forwards packets to/from ATAK over an off-grid communication layer
MIT License
404 stars 42 forks source link

Invalid coordinates in nonAtakUserInfoFromNodeInfo() treated as valid #72

Closed a-f-G-U-C closed 3 years ago

a-f-G-U-C commented 3 years ago

In function nonAtakUserInfoFromNodeInfo(), if the extraction of lat/lon/alt data fails, the function returns a 0/0/0 triplet which is indistinguishable from a valid result (0/0/0 is a real place on Earth), and is indeed treated as valid elsewhere in the code.

https://github.com/paulmandal/atak-forwarder/blob/df53a8bb23b55f93d10c75f542ff66f14c4e6144/app/src/main/java/com/paulmandal/atak/forwarder/comm/commhardware/MeshtasticCommHardware.java#L421-L427

This causes the standalone devices that lose GPS lock to be plotted at 0/0/0 on the ATAK map, causing a false teleportation effect.

Suggestion

There are 2 options:

In any case, using 0/0/0 as default values or error codes should probably be avoided in this context.

paulmandal commented 3 years ago

Closing since https://github.com/paulmandal/atak-forwarder/pull/73 fixed this