From 56f998985127fa518abed930e6e26f7cd31d70bf Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 2 Feb 2023 12:08:16 -0600 Subject: [PATCH 1/5] Connection status --- meshtastic/connection_status.proto | 113 +++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 meshtastic/connection_status.proto diff --git a/meshtastic/connection_status.proto b/meshtastic/connection_status.proto new file mode 100644 index 0000000..007e00b --- /dev/null +++ b/meshtastic/connection_status.proto @@ -0,0 +1,113 @@ +syntax = "proto3"; + +package meshtastic; + +option optimize_for = LITE_RUNTIME; +option java_package = "com.geeksville.mesh"; +option java_outer_classname = "ConfigProtos"; +option go_package = "github.com/meshtastic/go/generated"; +option csharp_namespace = "Meshtastic.Protobufs"; +option swift_prefix = ""; + +import "meshtastic/module_config.proto"; + +message DeviceConnectionStatus { + /* + * WiFi Status + */ + optional TcpConnectionStatus wifi = 1; + /* + * WiFi Status + */ + optional EthernetConnectionStatus ethernet = 2; + + /* + * Bluetooth Status + */ + optional BluetoothConnectionStatus bluetooth = 3; + + /* + * Serial Status + */ + optional SerialConnectionStatus serial = 4; +} + +/* + * WiFi connection status + */ +message WifiConnectionStatus { + /* + * Connection status + */ + TcpConnectionStatus status = 1; + + /* + * WiFi access point ssid + */ + string ssid = 2; + + /* + * Rssi of wireless connection + */ + int32 rssi = 3; +} + +/* + * Ethernet connection status + */ +message EthernetConnectionStatus { + /* + * Connection status + */ + TcpConnectionStatus status = 1; +} + +/* + * Ethernet or WiFi connection status + */ +message TcpConnectionStatus { + /* + * IP address of device + */ + fixed32 ip_address = 1; + + /* + * Whether the device has an active connection or not + */ + bool is_connected = 2; +} + +/* + * Bluetooth connection status + */ +message BluetoothConnectionStatus { + /* + * The pairing pin for bluetooth + */ + uint32 pin = 1; + + /* + * Rssi of bluetooth connection + */ + int32 rssi = 2; + + /* + * Whether the device has an active connection or not + */ + bool is_connected = 3; +} + +/* + * Serial connection status + */ + message SerialConnectionStatus { + /* + * The pairing pin for bluetooth + */ + Serial_Baud baud = 1; + + /* + * Whether the device has an active connection or not + */ + bool is_connected = 2; +} \ No newline at end of file From 9750628b431246ce48b7eb0e57746f6848a999e1 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 2 Feb 2023 12:12:16 -0600 Subject: [PATCH 2/5] Admin message side --- meshtastic/admin.proto | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index 02541e2..16ae1d0 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -14,6 +14,7 @@ import "meshtastic/config.proto"; import "meshtastic/device_metadata.proto"; import "meshtastic/mesh.proto"; import "meshtastic/module_config.proto"; +import "meshtastic/connection_status.proto"; /* * This message is handled by the Admin module and is responsible for all settings/channel read/write operations. @@ -190,6 +191,16 @@ message AdminMessage { */ string get_ringtone_response = 15; + /* + * Request the node to send it's connection status + */ + bool get_device_connection_status_request = 16; + + /* + * Device connection status response + */ + DeviceConnectionStatus get_device_connection_status_response = 17; + /* * Set the owner for this node */ From 507af7a516dad2eb70fe93c3a209a649d7c37da9 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 2 Feb 2023 12:13:23 -0600 Subject: [PATCH 3/5] Fix --- meshtastic/connection_status.proto | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meshtastic/connection_status.proto b/meshtastic/connection_status.proto index 007e00b..5203310 100644 --- a/meshtastic/connection_status.proto +++ b/meshtastic/connection_status.proto @@ -9,8 +9,6 @@ option go_package = "github.com/meshtastic/go/generated"; option csharp_namespace = "Meshtastic.Protobufs"; option swift_prefix = ""; -import "meshtastic/module_config.proto"; - message DeviceConnectionStatus { /* * WiFi Status @@ -102,9 +100,9 @@ message BluetoothConnectionStatus { */ message SerialConnectionStatus { /* - * The pairing pin for bluetooth + * The serial baud rate */ - Serial_Baud baud = 1; + uint32 baud = 1; /* * Whether the device has an active connection or not From c09f3260d361e8383684ba41e0af37af97001519 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 2 Feb 2023 12:17:13 -0600 Subject: [PATCH 4/5] Alignment --- meshtastic/connection_status.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/connection_status.proto b/meshtastic/connection_status.proto index 5203310..a5a2ef0 100644 --- a/meshtastic/connection_status.proto +++ b/meshtastic/connection_status.proto @@ -87,7 +87,7 @@ message BluetoothConnectionStatus { /* * Rssi of bluetooth connection */ - int32 rssi = 2; + int32 rssi = 2; /* * Whether the device has an active connection or not From f40243dcf5dcf4ccdc1fe9cd28667f9aaeb2360a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 2 Feb 2023 13:10:16 -0600 Subject: [PATCH 5/5] Added properties to NetworkConnectionStatus --- meshtastic/connection_status.proto | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/meshtastic/connection_status.proto b/meshtastic/connection_status.proto index a5a2ef0..d71b93f 100644 --- a/meshtastic/connection_status.proto +++ b/meshtastic/connection_status.proto @@ -13,7 +13,7 @@ message DeviceConnectionStatus { /* * WiFi Status */ - optional TcpConnectionStatus wifi = 1; + optional WifiConnectionStatus wifi = 1; /* * WiFi Status */ @@ -37,7 +37,7 @@ message WifiConnectionStatus { /* * Connection status */ - TcpConnectionStatus status = 1; + EthernetConnectionStatus status = 1; /* * WiFi access point ssid @@ -57,13 +57,13 @@ message EthernetConnectionStatus { /* * Connection status */ - TcpConnectionStatus status = 1; + NetworkConnectionStatus status = 1; } /* * Ethernet or WiFi connection status */ -message TcpConnectionStatus { +message NetworkConnectionStatus { /* * IP address of device */ @@ -73,6 +73,16 @@ message TcpConnectionStatus { * Whether the device has an active connection or not */ bool is_connected = 2; + + /* + * Whether the device has an active connection to an MQTT broker or not + */ + bool is_mqtt_connected = 3; + + /* + * Whether the device is actively remote syslogging or not + */ + bool is_syslog_connected = 4; } /*