Skip to content

from_stream method of Packet class fails #27

Closed
@lcongdon

Description

@lcongdon

The from_stream method of class Packet fails in Python 3.7.3 on Raspberry Pi.

Error message is:

Traceback (most recent call last):
  File "ble_prototype_host.py", line 63, in <module>
    packet = Packet.from_stream(stream)
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_bluefruit_connect/packet.py", line 107, in from_stream
    packet_class = cls._type_to_class.get(header, None)
TypeError: unhashable type: 'bytearray'

Can this be resolved by changing:

header = start + packet_type

on the previous line in the library to:

header = bytes(start + packet_type)

thus making header hashable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions