mirror of
https://github.com/meshtastic/python.git
synced 2026-04-29 03:13:56 -04:00
refactor of Tunnel() for unit testing; create unit tests for Tunnel()
This commit is contained in:
@@ -210,3 +210,18 @@ def remove_keys_from_dict(keys, adict):
|
||||
if key in adict:
|
||||
del newdict[key]
|
||||
return newdict
|
||||
|
||||
|
||||
def hexstr(barray):
|
||||
"""Print a string of hex digits"""
|
||||
return ":".join('{:02x}'.format(x) for x in barray)
|
||||
|
||||
|
||||
def ipstr(barray):
|
||||
"""Print a string of ip digits"""
|
||||
return ".".join('{}'.format(x) for x in barray)
|
||||
|
||||
|
||||
def readnet_u16(p, offset):
|
||||
"""Read big endian u16 (network byte order)"""
|
||||
return p[offset] * 256 + p[offset + 1]
|
||||
|
||||
Reference in New Issue
Block a user