MCPcopy
hub / github.com/ECTO-1A/AppleJuice / raw_packet_to_str

Function raw_packet_to_str

utils/bluetooth_utils.py:152–159  ·  view source on GitHub ↗

Returns the string representation of a raw HCI packet.

(pkt)

Source from the content-addressed store, hash-verified

150
151
152def raw_packet_to_str(pkt):
153 """
154 Returns the string representation of a raw HCI packet.
155 """
156 if sys.version_info > (3, 0):
157 return ''.join('%02x' % struct.unpack("B", bytes([x]))[0] for x in pkt)
158 else:
159 return ''.join('%02x' % struct.unpack("B", x)[0] for x in pkt)
160
161
162def enable_le_scan(sock, interval=0x0800, window=0x0800,

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected