diff --git a/docs/docs.md b/docs/docs.md index 5009feb..47a8be6 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -36,6 +36,7 @@ - [RouteDiscovery](#.RouteDiscovery) - [Routing](#.Routing) - [ToRadio](#.ToRadio) + - [ToRadio.PeerInfo](#.ToRadio.PeerInfo) - [User](#.User) - [Constants](#.Constants) @@ -646,6 +647,7 @@ Once the write completes the phone can assume it is handled. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | packet | [MeshPacket](#MeshPacket) | | send this packet on the mesh | +| peer_info | [ToRadio.PeerInfo](#ToRadio.PeerInfo) | | Information about the peer, sent after the phone sneds want_config_id. Old clients do not send this, which is fine. | | want_config_id | [uint32](#uint32) | | phone wants radio to send full node db to the phone, This is typically the first packet sent to the radio when the phone gets a bluetooth connection. The radio will respond by sending back a MyNodeInfo, a owner, a radio config and a series of FromRadio.node_infos, and config_complete the integer you write into this field will be reported back in the config_complete_id response this allows clients to never be confused by a stale old partially sent config. | | disconnect | [bool](#bool) | | Tell API server we are disconnecting now. This is useful for serial links where there is no hardware/protocol based notification that the client has dropped the link. (Sending this message is optional for clients) | @@ -654,6 +656,22 @@ Once the write completes the phone can assume it is handled. + + +### ToRadio.PeerInfo +Instead of sending want_config_id as a uint32, newer clients send this structure with information about the client. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| app_version | [uint32](#uint32) | | The numeric version code for the client application, which in some cases are used to control device behavior (so the device can make assumptions about who is using the API. | +| mqtt_gateway | [bool](#bool) | | True if the peer device can gateway MQTT packets. If true, the device will not try to send packets to the internet directly, instead it will pass the packets to the peer for dispatching. This feature is optional, if set to false the device will assume the client can not gateway to MQTT. | + + + + + + ### User diff --git a/mesh.proto b/mesh.proto index 228918c..cb134e5 100644 --- a/mesh.proto +++ b/mesh.proto @@ -861,6 +861,24 @@ message FromRadio { */ message ToRadio { + /* + * Instead of sending want_config_id as a uint32, newer clients send this structure with information about the client. + */ + message PeerInfo { + /* + * The numeric version code for the client application, which in some cases are used to control device behavior (so the device can + * make assumptions about who is using the API. + */ + uint32 app_version = 1; + + /* + * True if the peer device can gateway MQTT packets. If true, the device will not try to send packets to the internet directly, + * instead it will pass the packets to the peer for dispatching. + * This feature is optional, if set to false the device will assume the client can not gateway to MQTT. + */ + bool mqtt_gateway = 2; + } + /* * In the <1.2 versions packet had ID 2, to prevent confusing old apps with our new packets, we've changed. * 101-103 were used for set_radio, set_owner, set_channel @@ -874,6 +892,11 @@ message ToRadio { */ MeshPacket packet = 2; + /* + * Information about the peer, sent after the phone sneds want_config_id. Old clients do not send this, which is fine. + */ + PeerInfo peer_info = 3; + /* * phone wants radio to send full node db to the phone, This is * typically the first packet sent to the radio when the phone gets a