-
Notifications
You must be signed in to change notification settings - Fork 115
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
ManufacturerData in Peripheral mode #323
Comments
There are no immediate plans to add manufacturer data to the advertisements. Manufacturer data has always been a low priority because they require company identifiers and my opinion has been that if people have the money and knowledgeable to be getting a Company Identifier Code, then they are likely not be using Bluezero. My concern is that if I add support for manufacturer data then people who don't have them will be tempted to use values that they haven't registered. If people are creating beacons then I steer them towards using Eddystone beacons which uses service data. If they are creating a peripheral then I encourage them to use a combination of device name and advertised service UUIDs to identify their device. Of course a peripheral can also use service data if they have a custom service UUID. Technically, adding support for manufacturer data is not particularly challenging. It will look very similar to the getter/setter above used for service data using the property documented at: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/advertising-api.txt#n48 python-bluezero/bluezero/advertisement.py Lines 114 to 128 in 55f7e2b
Then in peripheral, add the property to the python-bluezero/bluezero/peripheral.py Lines 123 to 128 in 55f7e2b
|
Hi, thank you for your response. I just modified the advertisement.py and peripheral.py and now my codo looks like this: In the advertisement.py file:
in the peripheral.py file:
Now i getting the following error when it's trying to register the advertisement: NOTE: |
What you did seemed correct to me so I made the same changes as you in cpu_monitor.advert.manufacturer_data = {0xffff: [0x00, 0x01]} And it worked correctly. If I then extended the data to be the same length of data as you had then I could reproduce the error:
I used
Although the same information is available with:
Seems like you are bumping up against the maximum amount of data you can have in an advertisement... |
I tried to change the manufacturer data and I got the same result.
Then I added two services, one with eight characteristics and one with two |
Okay so I check may services UUID's:
After I remove the seccond one I could run the script and create the advertisement packet. May you explain me why? |
For each advertisement you only get a few (~28) bytes of data. As you will have seen from There are various trade-offs you can make. I believe that BlueZ allows you to have up to 4 advertisements interleaved so you might be able to split your information over multiple adverts. You possibly don't need to advertise all of the services you device has to offer. This can be done by not marking them as Remember, an advertisement is about sharing enough information so that a client can identify the correct peripheral. |
Ok, in this case I think I will keep only the |
Hi, I'm trying to identify my ble devices using the manufacturer data present in advertisement packet, but that's not supported yet. If anyone knows a workaround or when this feature will be supported would be awesome. I need this for my bachelor's degree project.
Thanks in advance!
The text was updated successfully, but these errors were encountered: