diff options
| author | Christoph Berg <myon@debian.org> | 2026-09-26 23:24:03 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-09-26 23:24:03 +0200 |
| commit | 059831534c7e884f0a607ed86b582fd00d821731 (patch) | |
| tree | 76bcb67a78f8aa2654fd34c2ad801a62136b0170 /HoundTransmissionPolicy.cpp | |
| parent | d83a420f0517d7fc47aeb288a6a0cf4891784fcc (diff) | |
New upstream version 3.2.0~rc1+dfsgupstream/3.2.0_rc1+dfsg
Diffstat (limited to 'HoundTransmissionPolicy.cpp')
| -rw-r--r-- | HoundTransmissionPolicy.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/HoundTransmissionPolicy.cpp b/HoundTransmissionPolicy.cpp new file mode 100644 index 00000000..27990312 --- /dev/null +++ b/HoundTransmissionPolicy.cpp @@ -0,0 +1,54 @@ +#include "HoundTransmissionPolicy.hpp" + +namespace HoundTransmissionPolicy +{ + ReplyPlan planFoxReportReply (State const& state, ReplyInput const& input) + { + ReplyPlan plan; + plan.nextState = state; + plan.nextState.foxFrequency = input.decodedFoxFrequency; + + if (input.tune) + { + return plan; + } + + plan.applyReply = true; + plan.txMessage = TxMessage::Tx3; + plan.report = input.sentReport; + plan.enableAuto = !input.autoEnabled; + plan.timeoutMilliseconds = static_cast<int> (11000.0 * input.trPeriod); + plan.nextState.replyState = ReplyState::FirstReplyPending; + if (Protocol::Classic == input.protocol) + { + plan.frequencyDecision.action = FrequencyAction::Set; + plan.frequencyDecision.frequency = input.decodedFoxFrequency; + } + return plan; + } + + TxStartPlan planClassicTxStart (State const& state, ClassicTxStartInput const& input) + { + TxStartPlan plan; + plan.nextState = state; + + if (input.autoEnabled && !input.tune && input.currentTxFrequency < 999 + && 3 != input.selectedTxMessage) + { + plan.frequencyDecision.action = FrequencyAction::RandomizeCalling; + } + + if (ReplyState::FirstReplySent == state.replyState && 3 == input.selectedTxMessage) + { + plan.frequencyDecision.action = FrequencyAction::Set; + plan.frequencyDecision.frequency = state.foxFrequency <= 600 + ? state.foxFrequency + 300 : state.foxFrequency - 300; + } + + if (ReplyState::FirstReplyPending == state.replyState) + { + plan.nextState.replyState = ReplyState::FirstReplySent; + } + return plan; + } +} |
