HBLink-org/hblink3

Talker Alias causes an Exception

Closed this issue · 1 comments

Hi,

I am using hblink in a bridged configuration and have noticed DMRA frames cause an exception in the logs:

Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 86, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
--- <exception caught here> ---
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/udp.py", line 249, in doRead
    self.protocol.datagramReceived(data, addr)
  File "/opt/hblink3/hblink.py", line 532, in master_datagramReceived
    logger.info('(%s) Recieved DMR Talker Alias from peer %s, subscriber %s', self._system, self._peers[_peer_id]['CALLSIGN'], int_id(_rf_src))
builtins.UnboundLocalError: local variable '_rf_src' referenced before assignment

Looking at the code, _rf_src is indeed referenced before assignment. A quick fix would be to just pass DMRA frames but it would be nice to extract the info I guess.

Thanks
Matthew
2E0SIP

Let's just use the first one, since this looks like a literal duplicate.