Working on RSSI

Added easy-change capabilities (IPSC flags) to dmrlink.py
Working with XCMP/XNL and RSSI in log.py
This commit is contained in:
Cort Buffington 2013-10-30 07:57:17 -05:00
parent 8f2e1433be
commit 09e1d7f36a
2 changed files with 8 additions and 8 deletions

View File

@ -139,7 +139,9 @@ for section in config.sections():
})
if NETWORK[section]['LOCAL']['AUTH_ENABLED']:
NETWORK[section]['LOCAL']['FLAGS'] = '\x00\x00\x00\x1C'
# 0x1C - Voice and Data calls only, 0xDC - Voice, Data and XCMP/XNL
#NETWORK[section]['LOCAL']['FLAGS'] = '\x00\x00\x00\x1C'
NETWORK[section]['LOCAL']['FLAGS'] = '\x00\x00\x00\xDC'
else:
NETWORK[section]['LOCAL']['FLAGS'] = '\x00\x00\x00\x0C'

12
log.py
View File

@ -37,17 +37,15 @@ class logIPSC(IPSC):
print('({}) Call Control Type 3 Packet Received' .format(_network))
def xcmp_xnl(self, _network, _data):
print('({}) XCMP/XNL Packet Received From: {}' .format(_network, _src_sub))
print('({}) XCMP/XNL Packet Received From: {}' .format(_network, binascii.b2a_hex(_data)))
def group_voice(self, _network, _src_sub, _dst_sub, _ts, _end, _peerid, _data):
# _log = logger.debug
if _data[30:31] == '\x01':
rssi = struct.unpack('h', _data[-2:])
rssi1 = struct.unpack('b', _data[-1])
rssi2 = struct.unpack('b', _data[-2:-1])
print('RSSI: ', rssi)
print('RSSI1: ', rssi1)
print('RSSI2: ', rssi2)
rssi1 = struct.unpack('B', _data[-1])[0]
rssi2 = struct.unpack('B', _data[-2:-1])[0]
rssi = (rssi1 + (((rssi2*1000)+128)/256000))
print('RSSI (not quite correct yet): ', rssi)
if (_ts not in self.ACTIVE_CALLS) or _end:
_time = time.strftime('%m/%d/%y %H:%M:%S')
_dst_sub = get_info(int_id(_dst_sub))