From 7858f566b1997806c0c2b57155a4469df02023b8 Mon Sep 17 00:00:00 2001 From: n0mjs710 Date: Tue, 11 Feb 2020 15:23:11 -0600 Subject: [PATCH] Added Data Types and fixed LC Opt error --- dmr_utils3/const.py | 31 ++++++++++++++++++++++++++++--- setup.py | 2 +- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/dmr_utils3/const.py b/dmr_utils3/const.py index 4613c6a..67375c1 100755 --- a/dmr_utils3/const.py +++ b/dmr_utils3/const.py @@ -44,8 +44,10 @@ SYNC = { 'BS_DATA': BS_DATA_SYNC } -# LC Options - Use for Group Voice -LC_OPT = b'\x00\x00\x20' +# LC Options - G for Group, U for unit, LC_OPT is legacy for group. +LC_OPT_G = b'\x00\x00\x00' +LC_OPT_U = b'\x03\x00\x00' +LC_OPT = LC_OPT_G # Precomputed EMB values, where CC always = 1, and PI always = 0 EMB = { @@ -87,6 +89,29 @@ LC_VOICE = { 'SVC-NONE': bitarray('00000000') } +# Data Type as defined for use in the Slot Type Message +DATA_TYPE = { + 'PI_HEAD': bitarray('0000'), + 'VOICE_LC_HEAD': bitarray('0001'), + 'VOICE_LC_TERM': bitarray('0010'), + 'CSBK': bitarray('0011'), + 'MBC_HEAD': bitarray('0100'), + 'MBC_CONT': bitarray('0101'), + 'DATA_HEAD': bitarray('0110'), + '1/2_RATE': bitarray('0111'), + '3/4_RATE': bitarray('1000'), + 'IDLE': bitarray('1001'), + '1/1_RATE': bitarray('1010'), + 'RES_1': bitarray('1011'), + 'RES_2': bitarray('1100'), + 'RES_3': bitarray('1101'), + 'RES_4': bitarray('1110'), + 'RES_5': bitarray('1111') +} + + + + ''' EMB: CC(4b), PI(1b), LCSS(2b), EMB Parity(9b - QR 16,7,5) Slot Type: CC(4b), DataType(4), Slot Type Parity(12b - ) @@ -104,4 +129,4 @@ if __name__ == '__main__': pprint(SYNC) pprint(EMB) pprint(SLOT_TYPE) - print(LC_OPT) \ No newline at end of file + print(LC_OPT) diff --git a/setup.py b/setup.py index 78f1a59..246a105 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ def readme(): return file.read() setup(name='dmr_utils3', - version='0.1.26', + version='0.1.28', description='ETSI DMR (Digital Mobile Radio) Tier II Utilities', long_description='Modules to disassemble and assemble DMR packets, including generating and decoding various FEC routines', classifiers=[