nRF24 / pyRF24

A python package that wraps the RF24, RF24Network, and RF24Mesh C++ libraries.
http://pyrf24.rtfd.io
GNU General Public License v2.0
24 stars 3 forks source link

Fix BLE advertised PA level #8

Closed 2bndy5 closed 2 years ago

2bndy5 commented 2 years ago

This fixes an oversight in _fakeble.py for which the enum value is not recognized as an int when adding the advertised PA level in a BLE payload.

Full traceback error ``` Traceback (most recent call last): File "examples/fake_ble_test.py", line 196, in while set_role(): File "examples/fake_ble_test.py", line 174, in set_role master(*[int(x) for x in user_input[1:]]) File "examples/fake_ble_test.py", line 75, in master ble.advertise(battery_service.buffer, data_type=0x16) File "/home/pi/github/env/lib/python3.7/site-packages/pyrf24/fake_ble.py", line 616, in advertise payload = self.whiten(self._make_payload(payload)) File "/home/pi/github/env/lib/python3.7/site-packages/pyrf24/fake_ble.py", line 530, in _make_payload pa_level = chunk(struct.pack(">b", self._radio.pa_level), 0x0A) struct.error: required argument is not an integer ```

Also fixed some pylint & spelling errors in _streamingdata.py example.