mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 01:32:40 +00:00
Set ham mode admin message
This commit is contained in:
@@ -106,6 +106,10 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
||||
else
|
||||
handleSetChannel(r->set_channel);
|
||||
break;
|
||||
case meshtastic_AdminMessage_set_ham_mode_tag:
|
||||
LOG_INFO("Client is setting ham mode\n");
|
||||
handleSetHamMode(r->set_ham_mode);
|
||||
break;
|
||||
|
||||
/**
|
||||
* Other
|
||||
@@ -598,6 +602,18 @@ void AdminModule::saveChanges(int saveWhat, bool shouldReboot)
|
||||
}
|
||||
}
|
||||
|
||||
void AdminModule::handleSetHamMode(const meshtastic_HamParameters &p)
|
||||
{
|
||||
strncpy(owner.long_name, p.call_sign, sizeof(owner.long_name));
|
||||
owner.is_licensed = true;
|
||||
config.lora.override_duty_cycle = true;
|
||||
config.lora.tx_power = p.tx_power;
|
||||
config.lora.override_frequency = p.frequency;
|
||||
|
||||
service.reloadOwner(!hasOpenEditTransaction);
|
||||
service.reloadConfig(SEGMENT_CONFIG | SEGMENT_DEVICESTATE);
|
||||
}
|
||||
|
||||
AdminModule::AdminModule() : ProtobufModule("Admin", meshtastic_PortNum_ADMIN_APP, &meshtastic_AdminMessage_msg)
|
||||
{
|
||||
// restrict to the admin channel for rx
|
||||
|
||||
Reference in New Issue
Block a user