-
Notifications
You must be signed in to change notification settings - Fork 57
prefix building #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The first makes sense to me. I'm not sure you can do the any or all currently with the native _bleio filtering. I believe it's always any. |
Right, I was thinking only of the Python-based filtering. Right now you have to override the |
Can you show how |
I'm working on a PR that includes this, and after working through a couple of ideas, I'm now just using a tuple of bytes, e.g.
For
Basically, you don't have to concatenate the prefixes yourself, and you don't have to do length-counting yourself (which reminds me of FORTRAN Hollerith counting: |
I've been building up a few more observations in #79 (comment). I have just noticed that setting |
There is a bug (adafruit/circuitpython#2973) that manifests when the prefix matching is "all" rather than "any". I don't know if that would cover your case here. Could you point to your code? Could you show the raw advertisement and scan response that do not work with the current matching? The library could add the
For the problem you're trying to solve, would using connected services rather than advertisements also work? Also, have you looked at https://github.com/adafruit/Adafruit_CircuitPython_BLE_Radio, which would push the parsing and building to your code, but might make things clearer because of that? |
I didn't know about https://github.com/adafruit/Adafruit_CircuitPython_BLE_Radio . I had a glance at the code and it's interesting to see that it's still based on |
Yes, the "channel" numbers" are just an ID, not a frequency channel. Extended advertising can work on devices that support it. This is meant to be between CircuitPython devices. If it doesn't work, let us know, of course. |
I've not read about the extended Advertising support, do all CircuitPython devices support it? In terms of devices that would cover the Raspberry Pis too, wouldn't it? I always forget people use the CP libraries there. Is this the feature from Bluetooth 4.2 than enables it http://software-dl.ti.com/lprf/sdg-latest/html/ble-stack-3.x/data-length-extensions.html ? |
The nRF52840 (and therefore CPy) do support this. The two sides of a connection negotiate this. |
I had not realised the Adafruit_CircuitPython_BLE/adafruit_ble/advertising/standard.py Lines 168 to 186 in ffd1f1d
|
Currently the advertising
prefix
mechanism requires counting bytes and manually including a length. I was thinking about some helper functions for this. Straw ideas:The class method would add length headers and merge into a single
bytes
and maybe also include any/all matching designation in a
Prefix
object:The
prefix
class-variable name might be renamed toprefixes
ormatch_prefixes
, since it's actually multiple prefixes.The text was updated successfully, but these errors were encountered: