add peer_info to support mqtt forwarding via phones

pull/19/head
Kevin Hester 2021-04-11 09:24:14 +08:00
rodzic 858d816b8c
commit ff66c54949
2 zmienionych plików z 41 dodań i 0 usunięć

Wyświetl plik

@ -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.
<a name=".ToRadio.PeerInfo"></a>
### 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. |
<a name=".User"></a>
### User

Wyświetl plik

@ -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