Fixed registration packet mangling

This commit is contained in:
Cort Buffington 2019-01-07 10:47:53 -06:00
parent 90a889ec3b
commit 9ae4704d98

View File

@ -270,15 +270,15 @@ class HBSYSTEM(DatagramProtocol):
#logger.debug('(%s) Packet sent to peer %s', self._system, self._peers[_peer]['RADIO_ID'])
def send_peer(self, _peer, _packet):
#if _packet[:4] == 'DMRD':
self.transport.write(b''.join([_packet[:11], _peer, _packet[15:]]), self._peers[_peer]['SOCKADDR'])
if _packet[:4] == 'DMRD':
_packet = b''.join([_packet[:11], _peer, _packet[15:]])
self.transport.write(_packet, self._peers[_peer]['SOCKADDR'])
# KEEP THE FOLLOWING COMMENTED OUT UNLESS YOU'RE DEBUGGING DEEPLY!!!!
#logger.debug('(%s) TX Packet to %s on port %s: %s', self._peers[_peer]['RADIO_ID'], self._peers[_peer]['IP'], self._peers[_peer]['PORT'], ahex(_packet))
def send_master(self, _packet):
#if _packet[:4] == b'DMRD':
# _packet = _packet[:11] + self._config['RADIO_ID'] + _packet[15:]
_packet = b''.join([_packet[:11], self._config['RADIO_ID'], _packet[15:]])
if _packet[:4] == b'DMRD':
_packet = b''.join([_packet[:11], self._config['RADIO_ID'], _packet[15:]])
self.transport.write(_packet, self._config['MASTER_SOCKADDR'])
# KEEP THE FOLLOWING COMMENTED OUT UNLESS YOU'RE DEBUGGING DEEPLY!!!!
# logger.debug('(%s) TX Packet to %s:%s -- %s', self._system, self._config['MASTER_IP'], self._config['MASTER_PORT'], ahex(_packet))