get settings message works

pull/706/head
Kevin Hester 2021-02-26 20:10:41 +08:00
rodzic c7c8b34adf
commit 0307e4161e
3 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -21,6 +21,7 @@ You probably don't care about this section - skip to the next one.
* implement 'get channels' Admin plugin operation
* use get-channels from python
* use set-channel from python
* combine acks and responses in a single message if possible
* use portuino TCP connection to debug with python API
* make python tests more exhaustive
* document the relationship between want_response (indicating remote node received it) and want_ack (indicating that this message should be sent reliably - and also get acks from the first rx node and naks if it is never delivered)

Wyświetl plik

@ -47,8 +47,12 @@ void MeshPlugin::callPlugins(const MeshPacket &mp)
bool handled = pi.handleReceived(mp);
// Possibly send replies (but only if the message was directed to us specifically, i.e. not for promiscious sniffing), also not if we sent it
if (mp.decoded.want_response && toUs && mp.from != ourNodeNum) {
// Possibly send replies (but only if the message was directed to us specifically, i.e. not for promiscious sniffing)
// NOTE: we send a reply *even if the (non broadcast) request was from us* which is unfortunate but necessary because currently when the phone
// sends things, it sends things using the local node ID as the from address. A better solution (FIXME) would be to let phones
// have their own distinct addresses and we 'route' to them like any other node.
if (mp.decoded.want_response && toUs && (mp.from != ourNodeNum || mp.to == ourNodeNum)) {
pi.sendResponse(mp);
DEBUG_MSG("Plugin %s sent a response\n", pi.name);
}

Wyświetl plik

@ -13,6 +13,7 @@ void AdminPlugin::handleGetChannel(const MeshPacket &req, uint32_t channelIndex)
// We create the reply here
AdminMessage r = AdminMessage_init_default;
r.get_channel_response = channels.getByIndex(channelIndex);
r.which_variant = AdminMessage_get_channel_response_tag;
reply = allocDataProtobuf(r);
}
}
@ -23,6 +24,7 @@ void AdminPlugin::handleGetRadio(const MeshPacket &req)
// We create the reply here
AdminMessage r = AdminMessage_init_default;
r.get_radio_response = devicestate.radio;
r.which_variant = AdminMessage_get_radio_response_tag;
reply = allocDataProtobuf(r);
}
}