Merge pull request #1998 from GUVWAF/dutyCycleLimit

Completely refrain from transmitting if duty cycle limit exceeded
This commit is contained in:
Thomas Göttgens
2022-11-29 11:06:31 +01:00
committed by GitHub
9 changed files with 45 additions and 7 deletions

View File

@@ -192,6 +192,7 @@ bool AdminModule::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r)
void AdminModule::handleSetOwner(const User &o)
{
int changed = 0;
bool licensed_changed = false;
if (*o.long_name) {
changed |= strcmp(owner.long_name, o.long_name);
@@ -207,12 +208,14 @@ void AdminModule::handleSetOwner(const User &o)
}
if (owner.is_licensed != o.is_licensed) {
changed = 1;
licensed_changed = true;
owner.is_licensed = o.is_licensed;
config.lora.override_duty_cycle = owner.is_licensed; // override duty cycle for licensed operators
}
if (changed) { // If nothing really changed, don't broadcast on the network or write to flash
service.reloadOwner(!hasOpenEditTransaction);
saveChanges(SEGMENT_DEVICESTATE);
licensed_changed ? saveChanges(SEGMENT_CONFIG | SEGMENT_DEVICESTATE) : saveChanges(SEGMENT_DEVICESTATE);
}
}