|
| 1 | +/* Automatically generated nanopb header */ |
| 2 | +/* Generated by nanopb-0.4.7 */ |
| 3 | + |
| 4 | +#ifndef PB_MESHTASTIC_MESHTASTIC_ATAK_PB_H_INCLUDED |
| 5 | +#define PB_MESHTASTIC_MESHTASTIC_ATAK_PB_H_INCLUDED |
| 6 | +#include <pb.h> |
| 7 | + |
| 8 | +#if PB_PROTO_HEADER_VERSION != 40 |
| 9 | +#error Regenerate this file with the current version of nanopb generator. |
| 10 | +#endif |
| 11 | + |
| 12 | +/* Enum definitions */ |
| 13 | +typedef enum _meshtastic_Team { |
| 14 | + /* Unspecifed */ |
| 15 | + meshtastic_Team_Unspecifed_Color = 0, |
| 16 | + /* White */ |
| 17 | + meshtastic_Team_White = 1, |
| 18 | + /* Yellow */ |
| 19 | + meshtastic_Team_Yellow = 2, |
| 20 | + /* Orange */ |
| 21 | + meshtastic_Team_Orange = 3, |
| 22 | + /* Magenta */ |
| 23 | + meshtastic_Team_Magenta = 4, |
| 24 | + /* Red */ |
| 25 | + meshtastic_Team_Red = 5, |
| 26 | + /* Maroon */ |
| 27 | + meshtastic_Team_Maroon = 6, |
| 28 | + /* Purple */ |
| 29 | + meshtastic_Team_Purple = 7, |
| 30 | + /* Dark Blue */ |
| 31 | + meshtastic_Team_Dark_Blue = 8, |
| 32 | + /* Blue */ |
| 33 | + meshtastic_Team_Blue = 9, |
| 34 | + /* Cyan */ |
| 35 | + meshtastic_Team_Cyan = 10, |
| 36 | + /* Teal */ |
| 37 | + meshtastic_Team_Teal = 11, |
| 38 | + /* Green */ |
| 39 | + meshtastic_Team_Green = 12, |
| 40 | + /* Dark Green */ |
| 41 | + meshtastic_Team_Dark_Green = 13, |
| 42 | + /* Brown */ |
| 43 | + meshtastic_Team_Brown = 14 |
| 44 | +} meshtastic_Team; |
| 45 | + |
| 46 | +/* Role of the group member */ |
| 47 | +typedef enum _meshtastic_MemberRole { |
| 48 | + /* Unspecifed */ |
| 49 | + meshtastic_MemberRole_Unspecifed = 0, |
| 50 | + /* Team Member */ |
| 51 | + meshtastic_MemberRole_TeamMember = 1, |
| 52 | + /* Team Lead */ |
| 53 | + meshtastic_MemberRole_TeamLead = 2, |
| 54 | + /* Headquarters */ |
| 55 | + meshtastic_MemberRole_HQ = 3, |
| 56 | + /* Airsoft enthusiast */ |
| 57 | + meshtastic_MemberRole_Sniper = 4, |
| 58 | + /* Medic */ |
| 59 | + meshtastic_MemberRole_Medic = 5, |
| 60 | + /* ForwardObserver */ |
| 61 | + meshtastic_MemberRole_ForwardObserver = 6, |
| 62 | + /* Radio Telephone Operator */ |
| 63 | + meshtastic_MemberRole_RTO = 7, |
| 64 | + /* Doggo */ |
| 65 | + meshtastic_MemberRole_K9 = 8 |
| 66 | +} meshtastic_MemberRole; |
| 67 | + |
| 68 | +/* Struct definitions */ |
| 69 | +/* ATAK GeoChat message */ |
| 70 | +typedef struct _meshtastic_GeoChat { |
| 71 | + /* The text message */ |
| 72 | + char message[200]; |
| 73 | + /* Uid recipient of the message */ |
| 74 | + bool has_to; |
| 75 | + char to[120]; |
| 76 | +} meshtastic_GeoChat; |
| 77 | + |
| 78 | +/* ATAK Group |
| 79 | + <__group role='Team Member' name='Cyan'/> */ |
| 80 | +typedef struct _meshtastic_Group { |
| 81 | + /* Role of the group member */ |
| 82 | + meshtastic_MemberRole role; |
| 83 | + /* Team (color) |
| 84 | + Default Cyan */ |
| 85 | + meshtastic_Team team; |
| 86 | +} meshtastic_Group; |
| 87 | + |
| 88 | +/* ATAK EUD Status |
| 89 | + <status battery='100' /> */ |
| 90 | +typedef struct _meshtastic_Status { |
| 91 | + /* Battery level */ |
| 92 | + uint8_t battery; |
| 93 | +} meshtastic_Status; |
| 94 | + |
| 95 | +/* ATAK Contact |
| 96 | + <contact endpoint='0.0.0.0:4242:tcp' phone='+12345678' callsign='FALKE'/> */ |
| 97 | +typedef struct _meshtastic_Contact { |
| 98 | + /* Callsign */ |
| 99 | + char callsign[120]; |
| 100 | + /* Device callsign */ |
| 101 | + char device_callsign[120]; /* IP address of endpoint in integer form (0.0.0.0 default) */ |
| 102 | +} meshtastic_Contact; |
| 103 | + |
| 104 | +/* Position Location Information from ATAK */ |
| 105 | +typedef struct _meshtastic_PLI { |
| 106 | + /* The new preferred location encoding, multiply by 1e-7 to get degrees |
| 107 | + in floating point */ |
| 108 | + int32_t latitude_i; |
| 109 | + /* The new preferred location encoding, multiply by 1e-7 to get degrees |
| 110 | + in floating point */ |
| 111 | + int32_t longitude_i; |
| 112 | + /* Altitude (ATAK prefers HAE) */ |
| 113 | + int32_t altitude; |
| 114 | + /* Speed */ |
| 115 | + uint32_t speed; |
| 116 | + /* Course in degrees */ |
| 117 | + uint16_t course; |
| 118 | +} meshtastic_PLI; |
| 119 | + |
| 120 | +/* Packets for the official ATAK Plugin */ |
| 121 | +typedef struct _meshtastic_TAKPacket { |
| 122 | + /* Are the payloads strings compressed for LoRA transport? */ |
| 123 | + bool is_compressed; |
| 124 | + /* The contact / callsign for ATAK user */ |
| 125 | + bool has_contact; |
| 126 | + meshtastic_Contact contact; |
| 127 | + /* The group for ATAK user */ |
| 128 | + bool has_group; |
| 129 | + meshtastic_Group group; |
| 130 | + /* The status of the ATAK EUD */ |
| 131 | + bool has_status; |
| 132 | + meshtastic_Status status; |
| 133 | + pb_size_t which_payload_variant; |
| 134 | + union { |
| 135 | + /* TAK position report */ |
| 136 | + meshtastic_PLI pli; |
| 137 | + /* ATAK GeoChat message */ |
| 138 | + meshtastic_GeoChat chat; |
| 139 | + } payload_variant; |
| 140 | +} meshtastic_TAKPacket; |
| 141 | + |
| 142 | + |
| 143 | +#ifdef __cplusplus |
| 144 | +extern "C" { |
| 145 | +#endif |
| 146 | + |
| 147 | +/* Helper constants for enums */ |
| 148 | +#define _meshtastic_Team_MIN meshtastic_Team_Unspecifed_Color |
| 149 | +#define _meshtastic_Team_MAX meshtastic_Team_Brown |
| 150 | +#define _meshtastic_Team_ARRAYSIZE ((meshtastic_Team)(meshtastic_Team_Brown+1)) |
| 151 | + |
| 152 | +#define _meshtastic_MemberRole_MIN meshtastic_MemberRole_Unspecifed |
| 153 | +#define _meshtastic_MemberRole_MAX meshtastic_MemberRole_K9 |
| 154 | +#define _meshtastic_MemberRole_ARRAYSIZE ((meshtastic_MemberRole)(meshtastic_MemberRole_K9+1)) |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | +#define meshtastic_Group_role_ENUMTYPE meshtastic_MemberRole |
| 159 | +#define meshtastic_Group_team_ENUMTYPE meshtastic_Team |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | +/* Initializer values for message structs */ |
| 166 | +#define meshtastic_TAKPacket_init_default {0, false, meshtastic_Contact_init_default, false, meshtastic_Group_init_default, false, meshtastic_Status_init_default, 0, {meshtastic_PLI_init_default}} |
| 167 | +#define meshtastic_GeoChat_init_default {"", false, ""} |
| 168 | +#define meshtastic_Group_init_default {_meshtastic_MemberRole_MIN, _meshtastic_Team_MIN} |
| 169 | +#define meshtastic_Status_init_default {0} |
| 170 | +#define meshtastic_Contact_init_default {"", ""} |
| 171 | +#define meshtastic_PLI_init_default {0, 0, 0, 0, 0} |
| 172 | +#define meshtastic_TAKPacket_init_zero {0, false, meshtastic_Contact_init_zero, false, meshtastic_Group_init_zero, false, meshtastic_Status_init_zero, 0, {meshtastic_PLI_init_zero}} |
| 173 | +#define meshtastic_GeoChat_init_zero {"", false, ""} |
| 174 | +#define meshtastic_Group_init_zero {_meshtastic_MemberRole_MIN, _meshtastic_Team_MIN} |
| 175 | +#define meshtastic_Status_init_zero {0} |
| 176 | +#define meshtastic_Contact_init_zero {"", ""} |
| 177 | +#define meshtastic_PLI_init_zero {0, 0, 0, 0, 0} |
| 178 | + |
| 179 | +/* Field tags (for use in manual encoding/decoding) */ |
| 180 | +#define meshtastic_GeoChat_message_tag 1 |
| 181 | +#define meshtastic_GeoChat_to_tag 2 |
| 182 | +#define meshtastic_Group_role_tag 1 |
| 183 | +#define meshtastic_Group_team_tag 2 |
| 184 | +#define meshtastic_Status_battery_tag 1 |
| 185 | +#define meshtastic_Contact_callsign_tag 1 |
| 186 | +#define meshtastic_Contact_device_callsign_tag 2 |
| 187 | +#define meshtastic_PLI_latitude_i_tag 1 |
| 188 | +#define meshtastic_PLI_longitude_i_tag 2 |
| 189 | +#define meshtastic_PLI_altitude_tag 3 |
| 190 | +#define meshtastic_PLI_speed_tag 4 |
| 191 | +#define meshtastic_PLI_course_tag 5 |
| 192 | +#define meshtastic_TAKPacket_is_compressed_tag 1 |
| 193 | +#define meshtastic_TAKPacket_contact_tag 2 |
| 194 | +#define meshtastic_TAKPacket_group_tag 3 |
| 195 | +#define meshtastic_TAKPacket_status_tag 4 |
| 196 | +#define meshtastic_TAKPacket_pli_tag 5 |
| 197 | +#define meshtastic_TAKPacket_chat_tag 6 |
| 198 | + |
| 199 | +/* Struct field encoding specification for nanopb */ |
| 200 | +#define meshtastic_TAKPacket_FIELDLIST(X, a) \ |
| 201 | +X(a, STATIC, SINGULAR, BOOL, is_compressed, 1) \ |
| 202 | +X(a, STATIC, OPTIONAL, MESSAGE, contact, 2) \ |
| 203 | +X(a, STATIC, OPTIONAL, MESSAGE, group, 3) \ |
| 204 | +X(a, STATIC, OPTIONAL, MESSAGE, status, 4) \ |
| 205 | +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,pli,payload_variant.pli), 5) \ |
| 206 | +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,chat,payload_variant.chat), 6) |
| 207 | +#define meshtastic_TAKPacket_CALLBACK NULL |
| 208 | +#define meshtastic_TAKPacket_DEFAULT NULL |
| 209 | +#define meshtastic_TAKPacket_contact_MSGTYPE meshtastic_Contact |
| 210 | +#define meshtastic_TAKPacket_group_MSGTYPE meshtastic_Group |
| 211 | +#define meshtastic_TAKPacket_status_MSGTYPE meshtastic_Status |
| 212 | +#define meshtastic_TAKPacket_payload_variant_pli_MSGTYPE meshtastic_PLI |
| 213 | +#define meshtastic_TAKPacket_payload_variant_chat_MSGTYPE meshtastic_GeoChat |
| 214 | + |
| 215 | +#define meshtastic_GeoChat_FIELDLIST(X, a) \ |
| 216 | +X(a, STATIC, SINGULAR, STRING, message, 1) \ |
| 217 | +X(a, STATIC, OPTIONAL, STRING, to, 2) |
| 218 | +#define meshtastic_GeoChat_CALLBACK NULL |
| 219 | +#define meshtastic_GeoChat_DEFAULT NULL |
| 220 | + |
| 221 | +#define meshtastic_Group_FIELDLIST(X, a) \ |
| 222 | +X(a, STATIC, SINGULAR, UENUM, role, 1) \ |
| 223 | +X(a, STATIC, SINGULAR, UENUM, team, 2) |
| 224 | +#define meshtastic_Group_CALLBACK NULL |
| 225 | +#define meshtastic_Group_DEFAULT NULL |
| 226 | + |
| 227 | +#define meshtastic_Status_FIELDLIST(X, a) \ |
| 228 | +X(a, STATIC, SINGULAR, UINT32, battery, 1) |
| 229 | +#define meshtastic_Status_CALLBACK NULL |
| 230 | +#define meshtastic_Status_DEFAULT NULL |
| 231 | + |
| 232 | +#define meshtastic_Contact_FIELDLIST(X, a) \ |
| 233 | +X(a, STATIC, SINGULAR, STRING, callsign, 1) \ |
| 234 | +X(a, STATIC, SINGULAR, STRING, device_callsign, 2) |
| 235 | +#define meshtastic_Contact_CALLBACK NULL |
| 236 | +#define meshtastic_Contact_DEFAULT NULL |
| 237 | + |
| 238 | +#define meshtastic_PLI_FIELDLIST(X, a) \ |
| 239 | +X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 1) \ |
| 240 | +X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 2) \ |
| 241 | +X(a, STATIC, SINGULAR, INT32, altitude, 3) \ |
| 242 | +X(a, STATIC, SINGULAR, UINT32, speed, 4) \ |
| 243 | +X(a, STATIC, SINGULAR, UINT32, course, 5) |
| 244 | +#define meshtastic_PLI_CALLBACK NULL |
| 245 | +#define meshtastic_PLI_DEFAULT NULL |
| 246 | + |
| 247 | +extern const pb_msgdesc_t meshtastic_TAKPacket_msg; |
| 248 | +extern const pb_msgdesc_t meshtastic_GeoChat_msg; |
| 249 | +extern const pb_msgdesc_t meshtastic_Group_msg; |
| 250 | +extern const pb_msgdesc_t meshtastic_Status_msg; |
| 251 | +extern const pb_msgdesc_t meshtastic_Contact_msg; |
| 252 | +extern const pb_msgdesc_t meshtastic_PLI_msg; |
| 253 | + |
| 254 | +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ |
| 255 | +#define meshtastic_TAKPacket_fields &meshtastic_TAKPacket_msg |
| 256 | +#define meshtastic_GeoChat_fields &meshtastic_GeoChat_msg |
| 257 | +#define meshtastic_Group_fields &meshtastic_Group_msg |
| 258 | +#define meshtastic_Status_fields &meshtastic_Status_msg |
| 259 | +#define meshtastic_Contact_fields &meshtastic_Contact_msg |
| 260 | +#define meshtastic_PLI_fields &meshtastic_PLI_msg |
| 261 | + |
| 262 | +/* Maximum encoded size of messages (where known) */ |
| 263 | +#define meshtastic_Contact_size 242 |
| 264 | +#define meshtastic_GeoChat_size 323 |
| 265 | +#define meshtastic_Group_size 4 |
| 266 | +#define meshtastic_PLI_size 31 |
| 267 | +#define meshtastic_Status_size 3 |
| 268 | +#define meshtastic_TAKPacket_size 584 |
| 269 | + |
| 270 | +#ifdef __cplusplus |
| 271 | +} /* extern "C" */ |
| 272 | +#endif |
| 273 | + |
| 274 | +#endif |
0 commit comments