mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 01:52:48 +00:00
handle the new set_owner and set_radio messages
This commit is contained in:
parent
bd77d47215
commit
169d85d0fa
@ -28,6 +28,22 @@ void PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength)
|
|||||||
service.handleToRadio(p);
|
service.handleToRadio(p);
|
||||||
break;
|
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:
|
default:
|
||||||
DEBUG_MSG("Error: unexpected ToRadio variant\n");
|
DEBUG_MSG("Error: unexpected ToRadio variant\n");
|
||||||
break;
|
break;
|
||||||
|
@ -41,6 +41,9 @@ class PhoneAPI
|
|||||||
|
|
||||||
ToRadio toRadioScratch; // this is a static scratch object, any data must be copied elsewhere before returning
|
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:
|
public:
|
||||||
PhoneAPI();
|
PhoneAPI();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user