From 59a78e36711e24a20f40800e63eaf51fcd236bcf Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 29 Apr 2017 12:30:33 -0400 Subject: [PATCH] add hold command --- op25/gr-op25_repeater/apps/trunking.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/op25/gr-op25_repeater/apps/trunking.py b/op25/gr-op25_repeater/apps/trunking.py index 7260bf1..f294d6c 100644 --- a/op25/gr-op25_repeater/apps/trunking.py +++ b/op25/gr-op25_repeater/apps/trunking.py @@ -526,6 +526,7 @@ class rx_ctl (object): self.debug = debug self.tgid_hold = None self.tgid_hold_until = time.time() + self.hold_mode = False self.TGID_HOLD_TIME = 2.0 # TODO: make more configurable self.TGID_SKIP_TIME = 1.0 # TODO: make more configurable self.current_nac = None @@ -911,16 +912,29 @@ class rx_ctl (object): self.last_tdma_vf = curr_time elif command == 'duid7' or command == 'duid12': pass + elif command == 'hold': + if self.hold_mode is False and self.current_tgid: + self.tgid_hold = self.current_tgid + self.tgid_hold_until = curr_time + 86400 * 10000 + self.hold_mode = True + sys.stderr.write ('set hold until %f tgid %s\n' % (self.tgid_hold_until, self.current_tgid)) + elif self.hold_mode is True: + self.current_tgid = None + self.tgid_hold = None + self.tgid_hold_until = curr_time + self.hold_mode = False elif command == 'set_hold': if self.current_tgid: self.tgid_hold = self.current_tgid self.tgid_hold_until = curr_time + 86400 * 10000 + self.hold_mode = True print 'set hold until %f' % self.tgid_hold_until elif command == 'unset_hold': if self.current_tgid: self.current_tgid = None self.tgid_hold = None self.tgid_hold_until = curr_time + self.hold_mode = False elif command == 'skip' or command == 'lockout': if self.current_tgid: end_time = None @@ -930,6 +944,7 @@ class rx_ctl (object): self.current_tgid = None self.tgid_hold = None self.tgid_hold_until = curr_time + self.hold_mode = False if self.current_state != self.states.CC: new_state = self.states.CC new_frequency = tsys.trunk_cc