mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-07 14:08:51 +00:00
add handleSetChannel
This commit is contained in:
parent
2b10a03178
commit
05d237ee84
@ -87,6 +87,10 @@ void PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength)
|
|||||||
handleSetRadio(toRadioScratch.set_radio);
|
handleSetRadio(toRadioScratch.set_radio);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ToRadio_set_channel_tag:
|
||||||
|
DEBUG_MSG("Client is setting channel\n");
|
||||||
|
handleSetChannel(toRadioScratch.set_channel);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
DEBUG_MSG("Error: unexpected ToRadio variant\n");
|
DEBUG_MSG("Error: unexpected ToRadio variant\n");
|
||||||
break;
|
break;
|
||||||
@ -275,6 +279,17 @@ void PhoneAPI::handleSetOwner(const User &o)
|
|||||||
service.reloadOwner();
|
service.reloadOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PhoneAPI::handleSetChannel(const ChannelSettings &cc)
|
||||||
|
{
|
||||||
|
radioConfig.channel_settings = cc;
|
||||||
|
|
||||||
|
bool didReset = service.reloadConfig();
|
||||||
|
if (didReset) {
|
||||||
|
state = STATE_SEND_MY_INFO; // Squirt a completely new set of configs to the client
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void PhoneAPI::handleSetRadio(const RadioConfig &r)
|
void PhoneAPI::handleSetRadio(const RadioConfig &r)
|
||||||
{
|
{
|
||||||
radioConfig = r;
|
radioConfig = r;
|
||||||
|
@ -88,6 +88,7 @@ class PhoneAPI
|
|||||||
//
|
//
|
||||||
|
|
||||||
void handleSetOwner(const User &o);
|
void handleSetOwner(const User &o);
|
||||||
|
void handleSetChannel(const ChannelSettings &cc);
|
||||||
void handleSetRadio(const RadioConfig &r);
|
void handleSetRadio(const RadioConfig &r);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user