From 33fd03ca0d864d091f6745a2981875d706b63cb6 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Sat, 27 Nov 2021 10:03:15 -0800 Subject: [PATCH 1/3] Draft of SF protobuf --- store_and_forward.proto | 127 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 store_and_forward.proto diff --git a/store_and_forward.proto b/store_and_forward.proto new file mode 100644 index 0000000..7a2e738 --- /dev/null +++ b/store_and_forward.proto @@ -0,0 +1,127 @@ +syntax = "proto3"; + +option java_package = "com.geeksville.mesh"; +option java_outer_classname = "StoreAndForward"; +option optimize_for = LITE_RUNTIME; +option go_package = "github.com/meshtastic/gomeshproto"; + + + + + +message StoreAndForwardMessage { + + /* + * 1 - 100 = From router + * 101-200 = From client + */ + enum RequestResponse { + /* + * Unset/unused + */ + UNSET = 0; + + ROUTER_ERROR = 1; + + ROUTER_HEARTBEAT = 2; + + /* + * Router has requested the client respond. This can work as a + * "are you there" message. + */ + ROUTER_PING = 3; + + /* + * The response to a "Ping" + */ + ROUTER_PONG = 4; + + /* + * Router is currently busy. Please try again later. + */ + ROUTER_BUSY = 5; + + CLIENT_ERROR = 101; + + /* + * Client has requested a replay from the router. + */ + CLIENT_HISTORY = 102; + + /* + * Client has requested stats from the router. + */ + CLIENT_STATS = 103; + + /* + * Client has requested the router respond. This can work as a + * "are you there" message. + */ + CLIENT_PING = 104; + + /* + * The response to a "Ping" + */ + CLIENT_PONG = 105; + + MAX = 255; + } + + + message Statistics { + + /* + * Number of messages we have ever seen + */ + uint32 MessagesTotal = 1; + + /* + * Number of messages we have currently saved our history. + */ + uint32 MessagesSaved = 2; + + /* + * Maximum number of messages we will save + */ + uint32 MessagesMax = 3; + + /* + * Router uptime in seconds + */ + uint32 UpTime = 4; + + /* + * Number of times any client sent a request to the S&F. + */ + uint32 Requests = 5; + + /* + * Number of times the history was requested. + */ + uint32 RequestsHistory = 6; + + } + + message History { + + /* + * Number of that will be sent to the client + */ + uint32 HistoryMessages = 1; + + /* + * Earliest message (seconds since now) + */ + uint32 Earliest = 2; + + } + + + RequestResponse rr = 1; + + Statistics stats = 2; + + History history = 3; + + +} \ No newline at end of file From b82ebc0e79d6460599ad9ac11f642734469f94a7 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Sat, 27 Nov 2021 10:44:35 -0800 Subject: [PATCH 2/3] Update draft of SF Protobuf --- store_and_forward.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store_and_forward.proto b/store_and_forward.proto index 7a2e738..ad61f61 100644 --- a/store_and_forward.proto +++ b/store_and_forward.proto @@ -110,9 +110,9 @@ message StoreAndForwardMessage { uint32 HistoryMessages = 1; /* - * Earliest message (seconds since now) + * The window of messages that was used to filter the history client requested */ - uint32 Earliest = 2; + uint32 Window = 2; } From 9d325fd103e098b488fe2f729316dcf2c64c63cf Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Sun, 28 Nov 2021 19:22:43 -0800 Subject: [PATCH 3/3] Update to protobufs for S&F --- radioconfig.proto | 3 +++ store_and_forward.proto => storeforward.proto | 20 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) rename store_and_forward.proto => storeforward.proto (86%) diff --git a/radioconfig.proto b/radioconfig.proto index 59429b9..ebe27fe 100644 --- a/radioconfig.proto +++ b/radioconfig.proto @@ -493,7 +493,10 @@ message RadioConfig { *FIXME - Move this out of UserPreferences and into a section for plugin configuration. (was 136) */ bool store_forward_plugin_enabled = 148; + bool store_forward_plugin_heartbeat = 149; uint32 store_forward_plugin_records = 137; + uint32 store_forward_plugin_history_return_max = 138; + uint32 store_forward_plugin_history_return_window = 139; reserved 136; /* diff --git a/store_and_forward.proto b/storeforward.proto similarity index 86% rename from store_and_forward.proto rename to storeforward.proto index ad61f61..662aa7d 100644 --- a/store_and_forward.proto +++ b/storeforward.proto @@ -12,8 +12,8 @@ option go_package = "github.com/meshtastic/gomeshproto"; message StoreAndForwardMessage { /* - * 1 - 100 = From router - * 101-200 = From client + * 1 - 99 = From Router + * 101 - 199 = From Client */ enum RequestResponse { /* @@ -100,6 +100,22 @@ message StoreAndForwardMessage { */ uint32 RequestsHistory = 6; + /* + * Is the heartbeat enabled on the server? + */ + bool Heartbeat = 7; + + /* + * Is the heartbeat enabled on the server? + */ + uint32 ReturnMax = 8; + + /* + * Is the heartbeat enabled on the server? + */ + uint32 ReturnWindow = 9; + + } message History {