handle the new set_owner and set_radio messages

1.2-legacy
geeksville 2020-04-22 15:13:05 -07:00
rodzic bd77d47215
commit 169d85d0fa
2 zmienionych plików z 19 dodań i 0 usunięć

Wyświetl plik

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

Wyświetl plik

@ -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();