Skip to content

Does not work on macOS due to missing adapter address #14

Closed
@alexwhittemore

Description

@alexwhittemore

(Backstory: I'm mostly developing on a RasPi 4 or a Bluefruit Sense, but I'm also trying to do comparisons against code running on Mac, as here)

Merely trying to import broadcastnet fails on the macOS platform even though adafruit_blinka_bleio supports mac, on the basis that the adapter never gets an address on mac (Python 3.7.9):

>>> import adafruit_ble_broadcastnet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<....>/adafruit_ble_broadcastnet.py", line 67, in <module>
    _ble._adapter.address.address_bytes  # pylint: disable=protected-access
AttributeError: 'NoneType' object has no attribute 'address_bytes'

Relevant line in _bleio is 145 of https://github.com/adafruit/Adafruit_Blinka_bleio/blob/master/_bleio/adapter_.py: if it's not linux, an adapter just never gets an address.

I'm thinking this isn't actually necessary for bridge usage anyway? I'm going to try working around it and maybe submit a PR. I'm also open to being told it's foolish and underlying bleak support is insufficient on macos for other reasons.

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