diff options
author | Max <ikj1234i@yahoo.com> | 2017-04-29 12:30:33 -0400 |
---|---|---|
committer | Max <ikj1234i@yahoo.com> | 2017-04-29 12:30:33 -0400 |
commit | 59a78e36711e24a20f40800e63eaf51fcd236bcf (patch) | |
tree | a3b16c4fa9d6466fa6c2fb5313aafacc90d9ceee | |
parent | 10aaadf1cd4eef73b2d5b65afddd7cea7d580f8e (diff) |
add hold command
-rw-r--r-- | op25/gr-op25_repeater/apps/trunking.py | 15 |
1 files changed, 15 insertions, 0 deletions
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 |