diff --git a/src/PhoneAPI.cpp b/src/PhoneAPI.cpp index 66524b2cf..18a05228e 100644 --- a/src/PhoneAPI.cpp +++ b/src/PhoneAPI.cpp @@ -28,6 +28,22 @@ void PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength) service.handleToRadio(p); break; } + case ToRadio_want_config_id_tag: + config_nonce = toRadioScratch.variant.want_config_id; + DEBUG_MSG("Client wants config, nonce=%u\n", config_nonce); + state = STATE_SEND_MY_NODEINFO; + break; + + case ToRadio_set_owner_tag: + DEBUG_MSG("Client is setting owner\n"); + handleSetOwner(toRadioScratch.variant.set_owner); + break; + + case ToRadio_set_radio_tag: + DEBUG_MSG("Client is setting radio\n"); + handleSetRadio(toRadioScratch.variant.set_radio); + break; + default: DEBUG_MSG("Error: unexpected ToRadio variant\n"); break; diff --git a/src/PhoneAPI.h b/src/PhoneAPI.h index d8c129cce..3439730fa 100644 --- a/src/PhoneAPI.h +++ b/src/PhoneAPI.h @@ -41,6 +41,9 @@ class PhoneAPI ToRadio toRadioScratch; // this is a static scratch object, any data must be copied elsewhere before returning + /// Use to ensure that clients don't get confused about old messages from the radio + uint32_t config_nonce = 0; + public: PhoneAPI();