diff --git a/bridge_rules_SAMPLE.py b/bridge_rules_SAMPLE.py index 5bd213b..be09568 100644 --- a/bridge_rules_SAMPLE.py +++ b/bridge_rules_SAMPLE.py @@ -14,10 +14,14 @@ THIS EXAMPLE WILL NOT WORK AS IT IS - YOU MUST SPECIFY NAMES AND GROUP IDS!!! NOTE: Timeslot transcoding does not yet work (SRC_TS) and (DST_TS) are ignored ''' +def id(_id): + # Create a 3 byte TGID or UID from an integer + return hex(_id)[2:].rjust(6,'0').decode('hex') + RULES = { 'IPSC_FOO': { 'GROUP_VOICE': [ - {'SRC_GROUP': b'\x00\x00\x01', 'SRC_TS': 1, 'DST_NET': 'IPSC_BAR', 'DST_GROUP': b'\x00\x00\x02', 'DST_TS': 1}, + {'SRC_GROUP': id(1), 'SRC_TS': 1, 'DST_NET': 'IPSC_BAR', 'DST_GROUP': id(2), 'DST_TS': 1}, # Repeat the above line for as many rules for this IPSC network as you want. ], 'PRIVATE_VOICE': [ @@ -29,7 +33,7 @@ RULES = { }, 'IPSC_BAR:' { 'GROUP_VOICE': [ - {'SRC_GROUP': b'\x00\x00\x02', 'SRC_TS': 1, 'DST_NET': 'IPSC_FOO', 'DST_GROUP': b'\x00\x00\x01', 'DST_TS': 1}, + {'SRC_GROUP': id(2), 'SRC_TS': 1, 'DST_NET': 'IPSC_FOO', 'DST_GROUP': id(1), 'DST_TS': 1}, # Repeat the above line for as many rules for this IPSC network as you want. ], 'PRIVATE_VOICE': [