Skip to content
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

Add an AdafruitRadio Advertisement class. #33

Open
wants to merge 4 commits into
base: master
from
Open

Conversation

@ntoll
Copy link

ntoll commented Nov 18, 2019

DO NOT MERGE

This doesn't work, in so far as I'm able to broadcast messages with the new class but incoming messages don't appear to match via the prefix. When I test-scan without any specified prefixes I see the receiving device registers these messages, but they're filtered out if the prefix is specified.

Any hints would be most welcome. I'm sure I'm missing something really obvious but just not seeing it. ;-)

My tactic has been to take the working example code and modify it only slightly. As you can see, even this minimal change hasn't worked. :-/

ntoll added 2 commits Nov 18, 2019
@jerryneedell

This comment has been minimized.

Copy link
Contributor

jerryneedell commented Nov 18, 2019

Tested on on CPB with example from toll/adafruit_circuitpython_radio -- works for me!

@tannewt

This comment has been minimized.

Copy link
Contributor

tannewt commented Nov 19, 2019

I'd suggest loosening the prefix to filter only adafruit manufacturer data and then add a matches function that checks the manufacturer data map for the key. That will allow you to have a variable string length.

Are you planning on adding the other things such as group to the message?

@ntoll

This comment has been minimized.

Copy link
Author

ntoll commented Nov 19, 2019

Hmm.... @tannewt while I totally understand the words you use, I'm not quiet sure I understand them used together. ;-) (Imagine I'm Winnie the Pooh - a developer with a very little brain).

Can you point me at some docs -- docs = I'll be able to figure it out / figure out what I should be Googling.

Ack and agree about variable string length being desirable.

@tannewt

This comment has been minimized.

Copy link
Contributor

tannewt commented Nov 19, 2019

By loosening the prefix I mean shorten it so it matches all adafruit manufacturing data. Then override this to look for the specific key for radio data: https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/master/adafruit_ble/advertising/__init__.py#L256

I don't think there are any great docs yet since it all is very new.

ntoll added 2 commits Nov 25, 2019
@ntoll

This comment has been minimized.

Copy link
Author

ntoll commented Nov 25, 2019

OK, I've added what I think is the modification needed for extended messages. Please check..!

FWIW, I've tested on hardware and it works for me..! YMMV. ;-)

Still need to figure out the prefix related stuff. AFAICT, it just works right now and I'm not sure what benefit the change you're suggesting @tannewt would have.

@ntoll

This comment has been minimized.

Copy link
Author

ntoll commented Nov 25, 2019

Screenie of Mary Poppins testing the extended advertisement.... ;-)

supercalifragilisticexpialidotious

@tannewt

This comment has been minimized.

Copy link
Contributor

tannewt commented Nov 26, 2019

Thanks @ntoll, love the gif!

Shortening the prefix would allow you to vary the overall length of the advertisement. Right now it includes the total length which fixes it for all messages.

@tannewt

This comment has been minimized.

Copy link
Contributor

tannewt commented Dec 6, 2019

@ntoll Has this dropped off of your radar?

@ntoll

This comment has been minimized.

Copy link
Author

ntoll commented Dec 6, 2019

@tannewt 👋 nope... I've just been arranging my next gig (starting in January) and had to travel up to Edinburgh Wed->Thurs to give a talk at the British Computing Society. Busy week etc... ;-)

I'll try to take a look this weekend to dot the "i"s and cross the "t"s IYSWIM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.