mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 10:21:40 +00:00
Merge pull request #2253 from meshtastic/set-ham-mode
Set ham mode admin message
This commit is contained in:
commit
9e1f7c4f56
@ -106,6 +106,10 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
else
|
else
|
||||||
handleSetChannel(r->set_channel);
|
handleSetChannel(r->set_channel);
|
||||||
break;
|
break;
|
||||||
|
case meshtastic_AdminMessage_set_ham_mode_tag:
|
||||||
|
LOG_INFO("Client is setting ham mode\n");
|
||||||
|
handleSetHamMode(r->set_ham_mode);
|
||||||
|
break;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other
|
* 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(false);
|
||||||
|
service.reloadConfig(SEGMENT_CONFIG | SEGMENT_DEVICESTATE);
|
||||||
|
}
|
||||||
|
|
||||||
AdminModule::AdminModule() : ProtobufModule("Admin", meshtastic_PortNum_ADMIN_APP, &meshtastic_AdminMessage_msg)
|
AdminModule::AdminModule() : ProtobufModule("Admin", meshtastic_PortNum_ADMIN_APP, &meshtastic_AdminMessage_msg)
|
||||||
{
|
{
|
||||||
// restrict to the admin channel for rx
|
// restrict to the admin channel for rx
|
||||||
|
@ -43,6 +43,7 @@ class AdminModule : public ProtobufModule<meshtastic_AdminMessage>
|
|||||||
void handleSetConfig(const meshtastic_Config &c);
|
void handleSetConfig(const meshtastic_Config &c);
|
||||||
void handleSetModuleConfig(const meshtastic_ModuleConfig &c);
|
void handleSetModuleConfig(const meshtastic_ModuleConfig &c);
|
||||||
void handleSetChannel();
|
void handleSetChannel();
|
||||||
|
void handleSetHamMode(const meshtastic_HamParameters &req);
|
||||||
void reboot(int32_t seconds);
|
void reboot(int32_t seconds);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user