From 51765f3d16ae5774d63aabdb74339feb54926ff9 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 1 Feb 2024 19:11:15 -0600 Subject: [PATCH 01/15] TAK Packets --- meshtastic/mesh.proto | 44 ++++++++++++++++++++++++++++++++++++++- meshtastic/portnums.proto | 6 ++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 8f50b3c..118764b 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1518,4 +1518,46 @@ message DeviceMetadata { * Has Remote Hardware enabled */ bool hasRemoteHardware = 10; -} \ No newline at end of file +} + +/* + * Packets for the official ATAK Plugin + */ +message TAK_Packet +{ + string call_sign = 1; + /* + * The payload of the packet + */ + oneof payload_variant { + /* + * TAK position report + */ + TAK_PLI tak_pli = 1; + /* + * Other binary data + */ + bytes data = 2; + } +} +/* + * Position Location Information from ATAK + */ +message TAK_PLI { + /* + * The new preferred location encoding, multiply by 1e-7 to get degrees + * in floating point + */ + sfixed32 latitude_i = 1; + + /* + * The new preferred location encoding, multiply by 1e-7 to get degrees + * in floating point + */ + sfixed32 longitude_i = 2; + + /* + * Altitude + */ + int32 altitude = 3; +} diff --git a/meshtastic/portnums.proto b/meshtastic/portnums.proto index cd6bced..f781a35 100644 --- a/meshtastic/portnums.proto +++ b/meshtastic/portnums.proto @@ -184,6 +184,12 @@ enum PortNum { * ENCODING: Protobuf */ NEIGHBORINFO_APP = 71; + + /* + * ATAK Plugin + * Portnum for payloads from the official Meshtastic ATAK plugin + */ + ATAK_PLUGIN = 72; /* * Private applications should use portnums >= 256. From b171a4d8420bc843d23a7325a37aa181f66df948 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 1 Feb 2024 20:23:12 -0600 Subject: [PATCH 02/15] Indexing --- meshtastic/mesh.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 118764b..8344dee 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1533,11 +1533,11 @@ message TAK_Packet /* * TAK position report */ - TAK_PLI tak_pli = 1; + TAK_PLI tak_pli = 2; /* * Other binary data */ - bytes data = 2; + bytes data = 3; } } /* From cbc940238510ad8138bc18d30c64bc9a4220d6b5 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 2 Feb 2024 11:29:38 -0600 Subject: [PATCH 03/15] Compressed vs uncompressed variants --- meshtastic/mesh.options | 6 ++++-- meshtastic/mesh.proto | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index ad8bd71..d50e5f1 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -44,7 +44,6 @@ # MyMessage.name max_size:40 # or fixed_length or fixed_count, or max_count - #This value may want to be a few bytes smaller to compensate for the parent fields. *Compressed.data max_size:237 @@ -57,4 +56,7 @@ *MqttClientProxyMessage.topic max_size:60 *MqttClientProxyMessage.data max_size:435 -*MqttClientProxyMessage.text max_size:435 \ No newline at end of file +*MqttClientProxyMessage.text max_size:435 + +*TAK_Packet.callsign_variant.uncompressed max_size:64 +*TAK_Packet.callsign_variant.compressed max_size:64 diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 8344dee..3271df4 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1525,7 +1525,16 @@ message DeviceMetadata { */ message TAK_Packet { - string call_sign = 1; + oneof callsign_variant { + /* + * Uncompressed callsign from ATAK + */ + string uncompressed = 1; + /* + * Compressed callsign using unishox2 for the wire + */ + string compressed = 2; + } /* * The payload of the packet */ @@ -1533,11 +1542,11 @@ message TAK_Packet /* * TAK position report */ - TAK_PLI tak_pli = 2; + TAK_PLI tak_pli = 3; /* * Other binary data */ - bytes data = 3; + bytes data = 4; } } /* From 4ace085e2d40c5ce4b59c09dc1e3d632303497b1 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 2 Feb 2024 11:33:29 -0600 Subject: [PATCH 04/15] Prefix --- meshtastic/mesh.options | 4 ++-- meshtastic/mesh.proto | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index d50e5f1..6996bee 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -58,5 +58,5 @@ *MqttClientProxyMessage.data max_size:435 *MqttClientProxyMessage.text max_size:435 -*TAK_Packet.callsign_variant.uncompressed max_size:64 -*TAK_Packet.callsign_variant.compressed max_size:64 +*TAK_Packet.callsign_variant.callsign_uncompressed max_size:64 +*TAK_Packet.callsign_variant.callsign_compressed max_size:64 diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 3271df4..4804866 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1529,11 +1529,11 @@ message TAK_Packet /* * Uncompressed callsign from ATAK */ - string uncompressed = 1; + string callsign_uncompressed = 1; /* * Compressed callsign using unishox2 for the wire */ - string compressed = 2; + string callsign_compressed = 2; } /* * The payload of the packet From a5ecd23eddb74bd53bd8c147c0dd98d4645c70d2 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 2 Feb 2024 12:32:54 -0600 Subject: [PATCH 05/15] Correct options --- meshtastic/mesh.options | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index 6996bee..a2fe333 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -58,5 +58,5 @@ *MqttClientProxyMessage.data max_size:435 *MqttClientProxyMessage.text max_size:435 -*TAK_Packet.callsign_variant.callsign_uncompressed max_size:64 -*TAK_Packet.callsign_variant.callsign_compressed max_size:64 +*TAK_Packet.callsign_uncompressed max_size:64 +*TAK_Packet.callsign_compressed max_size:64 From 9288737832409c691b23659dd80d0715ee7d40c8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 6 Feb 2024 15:03:32 -0600 Subject: [PATCH 06/15] Update sizes --- meshtastic/mesh.options | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index a2fe333..c61015e 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -58,5 +58,5 @@ *MqttClientProxyMessage.data max_size:435 *MqttClientProxyMessage.text max_size:435 -*TAK_Packet.callsign_uncompressed max_size:64 -*TAK_Packet.callsign_compressed max_size:64 +*TAK_Packet.callsign_uncompressed max_size:512 +*TAK_Packet.callsign_compressed max_size:241 From c1ebf710dcb6ccd8839ec6fc169d5cf3b50298f8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Feb 2024 07:42:36 -0600 Subject: [PATCH 07/15] ATAK overhaul --- meshtastic/atak.options | 4 + meshtastic/atak.proto | 226 ++++++++++++++++++++++++++++++++++++++++ meshtastic/mesh.options | 3 - meshtastic/mesh.proto | 50 --------- 4 files changed, 230 insertions(+), 53 deletions(-) create mode 100644 meshtastic/atak.options create mode 100644 meshtastic/atak.proto diff --git a/meshtastic/atak.options b/meshtastic/atak.options new file mode 100644 index 0000000..59de6e8 --- /dev/null +++ b/meshtastic/atak.options @@ -0,0 +1,4 @@ +*TakPacket.callsign_uncompressed max_size:120 +*TakPacket.callsign_compressed max_size:64 + +*Status.battery int_size:8 \ No newline at end of file diff --git a/meshtastic/atak.proto b/meshtastic/atak.proto new file mode 100644 index 0000000..7f09540 --- /dev/null +++ b/meshtastic/atak.proto @@ -0,0 +1,226 @@ +syntax = "proto3"; + +package meshtastic; + +option csharp_namespace = "Meshtastic.Protobufs"; +option go_package = "github.com/meshtastic/go/generated"; +option java_outer_classname = "ATAKProtos"; +option java_package = "com.geeksville.mesh"; +option swift_prefix = ""; +/* + * Packets for the official ATAK Plugin + */ +message Packet +{ + /* + * The contact / callsign for ATAK user + */ + Contact contact = 1; + /* + * The group for ATAK user + */ + Group group = 2; + /* + * The status of the ATAK EUD + */ + Status status = 5; + /* + * The payload of the packet + */ + oneof payload_variant { + /* + * TAK position report + */ + PLI pli = 3; + /* + * Other binary data + */ + bytes data = 4; + } +} + +/* + * ATAK Group + * <__group role='Team Member' name='Cyan'/> + */ +message Group { + /* + * Role of the group member + */ + MemberRole role = 1; + /* + * Team (color) + * Default Cyan + */ + Team team = 2; +} + +enum Team { + /* + * Unspecifed + */ + Unspecifed_Color = 0; + /* + * White + */ + White = 1; + /* + * Yellow + */ + Yellow = 2; + /* + * Orange + */ + Orange = 3; + /* + * Magenta + */ + Magenta = 4; + /* + * Red + */ + Red = 5; + /* + * Maroon + */ + Maroon = 6; + /* + * Purple + */ + Purple = 7; + /* + * Dark Blue + */ + Dark_Blue = 8; + /* + * Blue + */ + Blue = 9; + /* + * Cyan + */ + Cyan = 10; + /* + * Teal + */ + Teal = 11; + /* + * Green + */ + Green = 12; + /* + * Dark Green + */ + Dark_Green = 13; + /* + * Brown + */ + Brown = 14; +} + +/* + * Role of the group member + */ +enum MemberRole { + /* + * Unspecifed + */ + Unspecifed = 0; + /* + * Team Member + */ + TeamMember = 1; + /* + * Team Lead + */ + TeamLead = 2; + /* + * Headquarters + */ + HQ = 3; + /* + * Airsoft enthusiast + */ + Sniper = 4; + /* + * Medic + */ + Medic = 5; + /* + * ForwardObserver + */ + ForwardObserver = 6; + /* + * Radio Telephone Operator + */ + RTO = 7; + /* + * Doggo + */ + K9 = 8; +} + +/* + * ATAK EUD Status + * + */ +message Status { + /* + * Battery level + */ + uint32 battery = 1; +} +/* + * ATAK Contact + * + */ +message Contact { + /* + * Compressed or uncompressed callsign + */ + oneof callsign_variant { + /* + * Uncompressed callsign from ATAK + */ + string callsign_uncompressed = 1; + /* + * Compressed callsign using unishox2 for the wire + */ + string callsign_compressed = 2; + } + /* + * IP address of endpoint in integer form (0.0.0.0 default) + */ + // fixed32 enpoint_address = 3; + /* + * Port of endpoint (4242 default) + */ + // uint32 endpoint_port = 4; + /* + * Phone represented as integer + * Terrible practice, but we really need the wire savings + */ + // uint32 phone = 4; +} + +/* + * Position Location Information from ATAK + */ +message PLI { + /* + * The new preferred location encoding, multiply by 1e-7 to get degrees + * in floating point + */ + sfixed32 latitude_i = 1; + + /* + * The new preferred location encoding, multiply by 1e-7 to get degrees + * in floating point + */ + sfixed32 longitude_i = 2; + + /* + * Altitude + */ + int32 altitude = 3; +} diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index c61015e..731b3bc 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -57,6 +57,3 @@ *MqttClientProxyMessage.topic max_size:60 *MqttClientProxyMessage.data max_size:435 *MqttClientProxyMessage.text max_size:435 - -*TAK_Packet.callsign_uncompressed max_size:512 -*TAK_Packet.callsign_compressed max_size:241 diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 4804866..95f378f 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1520,53 +1520,3 @@ message DeviceMetadata { bool hasRemoteHardware = 10; } -/* - * Packets for the official ATAK Plugin - */ -message TAK_Packet -{ - oneof callsign_variant { - /* - * Uncompressed callsign from ATAK - */ - string callsign_uncompressed = 1; - /* - * Compressed callsign using unishox2 for the wire - */ - string callsign_compressed = 2; - } - /* - * The payload of the packet - */ - oneof payload_variant { - /* - * TAK position report - */ - TAK_PLI tak_pli = 3; - /* - * Other binary data - */ - bytes data = 4; - } -} -/* - * Position Location Information from ATAK - */ -message TAK_PLI { - /* - * The new preferred location encoding, multiply by 1e-7 to get degrees - * in floating point - */ - sfixed32 latitude_i = 1; - - /* - * The new preferred location encoding, multiply by 1e-7 to get degrees - * in floating point - */ - sfixed32 longitude_i = 2; - - /* - * Altitude - */ - int32 altitude = 3; -} From c5c8d2c5d18b627a5f759b6b6f36b06faad8e4ad Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Feb 2024 07:45:27 -0600 Subject: [PATCH 08/15] Name --- meshtastic/atak.options | 4 ++-- meshtastic/atak.proto | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meshtastic/atak.options b/meshtastic/atak.options index 59de6e8..917b2f3 100644 --- a/meshtastic/atak.options +++ b/meshtastic/atak.options @@ -1,4 +1,4 @@ -*TakPacket.callsign_uncompressed max_size:120 -*TakPacket.callsign_compressed max_size:64 +*TAKPacket.callsign_uncompressed max_size:120 +*TAKPacket.callsign_compressed max_size:64 *Status.battery int_size:8 \ No newline at end of file diff --git a/meshtastic/atak.proto b/meshtastic/atak.proto index 7f09540..268ae5c 100644 --- a/meshtastic/atak.proto +++ b/meshtastic/atak.proto @@ -10,7 +10,7 @@ option swift_prefix = ""; /* * Packets for the official ATAK Plugin */ -message Packet +message TAKPacket { /* * The contact / callsign for ATAK user From 57d65d69d46831b75141ffcb83f471ea16c0c71d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Feb 2024 08:05:53 -0600 Subject: [PATCH 09/15] Length --- meshtastic/atak.options | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/atak.options b/meshtastic/atak.options index 917b2f3..ffce4d9 100644 --- a/meshtastic/atak.options +++ b/meshtastic/atak.options @@ -1,4 +1,4 @@ -*TAKPacket.callsign_uncompressed max_size:120 -*TAKPacket.callsign_compressed max_size:64 +*Contact.callsign_uncompressed max_size:120 +*Contact.callsign_compressed max_size:64 *Status.battery int_size:8 \ No newline at end of file From ca5b4deaaedee9f06c92f483f9a345d14dcbc86a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Feb 2024 09:53:31 -0600 Subject: [PATCH 10/15] Remove compression --- meshtastic/atak.options | 3 +-- meshtastic/atak.proto | 13 ++----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/meshtastic/atak.options b/meshtastic/atak.options index ffce4d9..fbfbc6e 100644 --- a/meshtastic/atak.options +++ b/meshtastic/atak.options @@ -1,4 +1,3 @@ -*Contact.callsign_uncompressed max_size:120 -*Contact.callsign_compressed max_size:64 +*Contact.callsign max_size:120 *Status.battery int_size:8 \ No newline at end of file diff --git a/meshtastic/atak.proto b/meshtastic/atak.proto index 268ae5c..6d3edca 100644 --- a/meshtastic/atak.proto +++ b/meshtastic/atak.proto @@ -176,18 +176,9 @@ message Status { */ message Contact { /* - * Compressed or uncompressed callsign + * Callsign */ - oneof callsign_variant { - /* - * Uncompressed callsign from ATAK - */ - string callsign_uncompressed = 1; - /* - * Compressed callsign using unishox2 for the wire - */ - string callsign_compressed = 2; - } + string callsign = 1; /* * IP address of endpoint in integer form (0.0.0.0 default) */ From 07ac3a02089f30de0ce669d7a5d2b2f04a1ad687 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Feb 2024 12:50:33 -0600 Subject: [PATCH 11/15] Track speed and course --- meshtastic/atak.options | 3 ++- meshtastic/atak.proto | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/meshtastic/atak.options b/meshtastic/atak.options index fbfbc6e..1f0f7e6 100644 --- a/meshtastic/atak.options +++ b/meshtastic/atak.options @@ -1,3 +1,4 @@ *Contact.callsign max_size:120 -*Status.battery int_size:8 \ No newline at end of file +*Status.battery int_size:8 +*PLI.course int_size:16 \ No newline at end of file diff --git a/meshtastic/atak.proto b/meshtastic/atak.proto index 6d3edca..669205a 100644 --- a/meshtastic/atak.proto +++ b/meshtastic/atak.proto @@ -211,7 +211,12 @@ message PLI { sfixed32 longitude_i = 2; /* - * Altitude + * Speed */ - int32 altitude = 3; + uint32 speed = 3; + + /* + * Course in degrees + */ + uint32 course = 4; } From 5fca196a6295873344eb0f4180a875d391eddf6d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Feb 2024 13:22:55 -0600 Subject: [PATCH 12/15] Oops --- meshtastic/atak.proto | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meshtastic/atak.proto b/meshtastic/atak.proto index 669205a..5569091 100644 --- a/meshtastic/atak.proto +++ b/meshtastic/atak.proto @@ -210,13 +210,18 @@ message PLI { */ sfixed32 longitude_i = 2; + /* + * Altitude (ATAK prefers HAE) + */ + uint32 altitude = 3; + /* * Speed */ - uint32 speed = 3; + uint32 speed = 4; /* * Course in degrees */ - uint32 course = 4; + uint32 course = 5; } From 703a85f4d8b3897b74aba1e982ee026b40f85773 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Feb 2024 16:42:54 -0600 Subject: [PATCH 13/15] Geochat --- meshtastic/atak.options | 4 ++-- meshtastic/atak.proto | 28 +++++++++++++++++++++------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/meshtastic/atak.options b/meshtastic/atak.options index 1f0f7e6..b567331 100644 --- a/meshtastic/atak.options +++ b/meshtastic/atak.options @@ -1,4 +1,4 @@ *Contact.callsign max_size:120 - *Status.battery int_size:8 -*PLI.course int_size:16 \ No newline at end of file +*PLI.course int_size:16 +*GeoChat.message max_size:200 \ No newline at end of file diff --git a/meshtastic/atak.proto b/meshtastic/atak.proto index 5569091..7c525f4 100644 --- a/meshtastic/atak.proto +++ b/meshtastic/atak.proto @@ -12,18 +12,22 @@ option swift_prefix = ""; */ message TAKPacket { + /* + * Are the payloads strings compressed for LoRA transport? + */ + boolean is_compressed = 1; /* * The contact / callsign for ATAK user */ - Contact contact = 1; + Contact contact = 2; /* * The group for ATAK user */ - Group group = 2; + Group group = 3; /* * The status of the ATAK EUD */ - Status status = 5; + Status status = 4; /* * The payload of the packet */ @@ -31,14 +35,24 @@ message TAKPacket /* * TAK position report */ - PLI pli = 3; + PLI pli = 5; /* - * Other binary data + * ATAK GeoChat message */ - bytes data = 4; + GeoChat chat = 6; } } +/* + * ATAK GeoChat message + */ +message GeoChat { + /* + * The text message + */ + string message = 1; +} + /* * ATAK Group * <__group role='Team Member' name='Cyan'/> @@ -224,4 +238,4 @@ message PLI { * Course in degrees */ uint32 course = 5; -} +} \ No newline at end of file From 16c05e31a970070b91f408ec483a2570fdd05728 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Feb 2024 16:44:15 -0600 Subject: [PATCH 14/15] bool --- meshtastic/atak.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/atak.proto b/meshtastic/atak.proto index 7c525f4..5b07e82 100644 --- a/meshtastic/atak.proto +++ b/meshtastic/atak.proto @@ -15,7 +15,7 @@ message TAKPacket /* * Are the payloads strings compressed for LoRA transport? */ - boolean is_compressed = 1; + bool is_compressed = 1; /* * The contact / callsign for ATAK user */ From eda5e8cee28182b6ad5ea1a411669b7fe787d6dd Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 8 Feb 2024 10:12:37 -0600 Subject: [PATCH 15/15] Add to --- meshtastic/atak.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meshtastic/atak.proto b/meshtastic/atak.proto index 5b07e82..ae8092e 100644 --- a/meshtastic/atak.proto +++ b/meshtastic/atak.proto @@ -51,6 +51,11 @@ message GeoChat { * The text message */ string message = 1; + + /* + * Uid recipient of the message + */ + optional string to = 2; } /*