paulmandal / atak-forwarder

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

Mesh packet type inconsistent with content #60

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

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

The plugin sends binary data objects over the meshtastic network, however the packet header falsely indicates the content type as CLEAR_TEXT (printable text) as a matter of default setting. This causes parsing errors in the firmware, as well as the python API.

It starts here: https://github.com/paulmandal/atak-forwarder/blob/5853ce9dd0fc213c74f578c16a7b487409af4509/app/src/main/java/com/paulmandal/atak/forwarder/comm/commhardware/MeshtasticCommHardware.java#L177

And gets tagged with the default setting here (meshtastic codebase): https://github.com/meshtastic/Meshtastic-Android/blob/312cf92b049a44f7bca891e67d9a72e619ef750d/app/src/main/java/com/geeksville/mesh/DataPacket.kt#L37

I believe (UNTESTED!) that the line above should say: (...) new DataPacket(targetId, message, MeshProtos.Data.Type.OPAQUE_VALUE)

This should ensure that the packet is passed through with minimum friction and without giving the meshtastic network any headaches.

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

It's actually a little more complex than that, I am preparing a PR.

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

Issue is fixed now. Closing with thanks.