Use int32s for lat/long - higher precision and 4 bytes less per packet

related to https://github.com/meshtastic/Meshtastic-device/issues/124
pull/2/head
geeksville 2020-05-04 07:43:15 -07:00
rodzic bd002e5a14
commit cabbdf51ed
2 zmienionych plików z 21 dodań i 2 usunięć

Wyświetl plik

@ -19,6 +19,10 @@
*ChannelSettings.psk max_size:16 fixed_length:true
*ChannelSettings.name max_size:12
# The device code doesn't use this legacy field - though the apps still might
*Position.latitude_d type:FT_IGNORE
*Position.longitude_d type:FT_IGNORE
*MyNodeInfo.firmware_version max_size:12
*MyNodeInfo.hw_model max_size:16
*MyNodeInfo.region max_size:12

Wyświetl plik

@ -62,8 +62,23 @@ Nanopb binaries available here: https://jpa.kapsi.fi/nanopb/download/ use nanopb
// a gps position
message Position {
double latitude = 1;
double longitude = 2;
/** DEPRECATED!
This old encoding is no longer sent by device loads, but applications could
still keep supporting it if the prefered latitude_i is not provided.
Device loads greater than 0.6.2 use the _i variants only.
I've switched to ints because a: more precise and b: half the # of bytes.
*/
double latitude_d = 1;
double longitude_d = 2;
/** The new preferred location encoding, divide by 10e-7 to get degrees in
* floating point */
int32 latitude_i = 7;
int32 longitude_i = 8;
int32 altitude = 3;
int32 battery_level = 4; // 1-100 (0 means not provided)