From afe41336317aabce733c2f6a0c27c788c4ff9b83 Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 1 Feb 2020 13:17:04 -0800 Subject: [PATCH] better nanopb --- app/src/main/proto/mesh.options | 2 +- app/src/main/proto/mesh.proto | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/proto/mesh.options b/app/src/main/proto/mesh.options index 8c3d2ab03..4d0c67405 100644 --- a/app/src/main/proto/mesh.options +++ b/app/src/main/proto/mesh.options @@ -1,7 +1,7 @@ # options for nanopb # https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options -*macaddr max_size:6 # macaddrs +*macaddr max_size:6 fixed_length:true # macaddrs *id max_size:16 # node id strings *User.long_name max_size:40 diff --git a/app/src/main/proto/mesh.proto b/app/src/main/proto/mesh.proto index e4cafe52d..8482a14dc 100644 --- a/app/src/main/proto/mesh.proto +++ b/app/src/main/proto/mesh.proto @@ -1,7 +1,8 @@ syntax = "proto3"; // per https://developers.google.com/protocol-buffers/docs/proto3 -package mesh; +// We are not placing any of these defs inside a package, because if you do the resulting nanopb version is super verbose +// package mesh; option java_package = "com.geeksville.mesh"; option java_outer_classname = "MeshProtos"; @@ -46,6 +47,9 @@ message Position { double longitude = 2; int32 altitude = 3; int32 battery_level = 4; // 0-100 + + /// true if this position came from the GPS inside the esp32 board, false if it was from a helper app on the phone + bool from_hardware = 5; } // Times are typically not sent over the mesh, but they will be added to any Packet (chain of SubPacket)