adafruit / adafruit/Adafruit_CircuitPython_BLE

A custom Advertisement with a constructor can fail to parse incoming BLE data correctly

Open
#86 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
138
Forks
58
PR merge metrics
No merged PRs in 30d

Description

This innocent looking constructor in a sub-class of `Advertisement`:

```
def __init__(self, enc_data=None, round=0):
super().__init__()
if enc_data is not None:
self.enc_data = enc_data
if round is not None:
self.round = round
```

was causing ads to be receieved on another Adafruit device use this library as

```
>
```

Minor possibility I've misdiagnosed this and they are sent like this due to a bug but this seems unlikely.

Originally mentioned in the comments of https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/79#issuecomment-634990957

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the custom Advertisement constructor shown in the issue and trace how incoming BLE data becomes the displayed manufacturer_data. Reproduce the reported parsing result on an Adafruit device if possible, then verify that advertisements received through a subclass constructor retain the expected data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.