From c1ebf710dcb6ccd8839ec6fc169d5cf3b50298f8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Feb 2024 07:42:36 -0600 Subject: [PATCH] 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; -}