aboutsummaryrefslogtreecommitdiffstats
path: root/op25
diff options
context:
space:
mode:
authorMax <ikj1234i@yahoo.com>2022-10-15 13:11:54 -0400
committerMax <ikj1234i@yahoo.com>2022-10-15 13:11:54 -0400
commit874b72042cc9c49ab87074daa99c56a8e7f4236f (patch)
tree9d56c752a0837cf81c41e612b91c981206cce257 /op25
parentebc980c2052197106b6c791ef4d4995c43472d72 (diff)
add TSBKs 29 and 35
Diffstat (limited to 'op25')
-rw-r--r--op25/gr-op25_repeater/apps/trunking.py32
1 files changed, 29 insertions, 3 deletions
diff --git a/op25/gr-op25_repeater/apps/trunking.py b/op25/gr-op25_repeater/apps/trunking.py
index 0ec3b59..c774e72 100644
--- a/op25/gr-op25_repeater/apps/trunking.py
+++ b/op25/gr-op25_repeater/apps/trunking.py
@@ -956,6 +956,31 @@ class trunked_system (object):
self.rfss_txchan = f1 + self.freq_table[chan >> 12]['offset']
if self.debug > 10:
sys.stderr.write('tsbk3a rfss status: syid: %x rfid %x stid %d ch1 %x(%s)\n' %(syid, rfid, stid, chan, self.channel_id_to_string(chan)))
+ elif opcode == 0x29: # secondary cc explicit
+ rfid = (tsbk >> 72) & 0xff # octet 2
+ stid = (tsbk >> 64) & 0xff # octet 3
+ ch_t = (tsbk >> 48) & 0xffff # octet 4,5
+ ch_r = (tsbk >> 24) & 0xffff # octet 7,8
+ ss = (tsbk >> 16) & 0xff # octet 9
+ ft = self.channel_id_to_frequency(ch_t)
+ if ft:
+ self.secondary[ft] = 1
+ if self.debug > 10:
+ sys.stderr.write('tsbk29 sccb_exp: rfid %x stid %d %x(%s) %x(%s)\n' %(rfid, stid, ch_t, self.channel_id_to_string(ch_t), ch_r, self.channel_id_to_string(ch_r)))
+ elif opcode == 0x35: # time and date
+ flags = (tsbk >> 76) & 0xf # octet 2 upper nib
+ local_time_offset = (tsbk >> 64) & 0xfff # octet 2 lower nib and octet 3
+ dt = (tsbk >> 40) & 0xffffff # octet 4-6
+ tm = (tsbk >> 16) & 0xffffff # octet 7-9
+ # TODO: FIXME: check 'flags' bits to verify time/date/offset valid prior to use
+ yy = (dt >> 2) & 0x1fff
+ dd = (dt >> 15) & 0x1f
+ mm = (dt >> 20) & 0xf
+ hh = (tm >> 19) & 0x1f
+ mn = (tm >> 13) & 0x3f
+ ss = (tm >> 7) & 0x3f
+ if self.debug > 10:
+ sys.stderr.write('tsbk35 time and date: flags %x offset %d %02d/%02d/%02d %02d:%02d:%02d\n' % (flags, local_time_offset, yy, mm, dd, hh, mn, ss))
elif opcode == 0x39: # secondary cc
rfid = (tsbk >> 72) & 0xff
stid = (tsbk >> 64) & 0xff
@@ -1081,11 +1106,12 @@ class trunked_system (object):
d = {'cc_event': 'ext_fnct_cmd', 'mfrid': mfrid, 'efclass': efclass, 'efoperand': efoperand, 'efargs': self.mk_src_dict(efargs), 'target': target, 'opcode': opcode}
self.post_event(d)
if self.debug > 10:
- sys.stderr.write('tsbk24 ext_fnct_cmd: efclass %d efoperand %d efargs %s sysid %s target %s\n' % (efclass, efoperand, efargs, sysid, target))
+ sys.stderr.write('tsbk24 ext_fnct_cmd: efclass %d efoperand %d efargs %s target %s\n' % (efclass, efoperand, efargs, target))
- #else:
- # sys.stderr.write('tsbk other %x\n' % opcode)
+ else:
+ if self.debug > 1:
+ sys.stderr.write('received unsupported TSBK opcode %x (%x)\n' % (opcode, tsbk))
return updated
def hunt_cc(self, curr_time):