128 bit Service Data in Advert

6 posts / 0 new
Last post
jjennings
Offline
Last seen:4 years 6 months ago
加入:2014-09-02 13:10
128 bit Service Data in Advert

I have a device that I want to send an ADC value in the advertising packet to a phone. This is for a custom service so I have generated a 128bit UUID for the service.

From the Bluetooth spec (https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-a...), I would like to use the type 0x21 «Service Data - 128-bit UUID», however when I try to put this type into the advertising packet no adverts are sent. It is not an issue with the length of the data overflowing the advertising packet as this is the only thing I am putting in the advert. Changing 0x21 to 0x09 (full device name) means adverts are sent with the data I want but obviously under the wrong type.

I've noticed 128 bit service data type is not defined in the enum in gap.h, does this mean that it cannot be used?

Thanks

JE_Dialog
Offline
Last seen:1 month 6 days ago
Staff
加入:2013-12-05 14:02
Hello , sorry for delay -

Hello , sorry for delay - been a very busy week - somebody is looking at your question and will respond shortly :

BR JE_Dialog

RvA
Offline
Last seen:2 weeks 2 days ago
Staff
加入:2014-02-07 14:10
Hi jjennings,

Hi jjennings,

As we are in direct email contact, no further comments will be posted under this topic.
Best regards,
RvA (Dialog)

Alex Luo
Offline
Last seen:1 year 3 months ago
Expert
加入:2014-02-28 19:16
Hello,

Hello,

Any solution to fix the issue? I have the same experience please let me share your solution.

Thanks!

Alex Luo
Offline
Last seen:1 year 3 months ago
Expert
加入:2014-02-28 19:16
Hello,

Hello,

Any solution to fix the issue? I had the same experience please let me share your solution. I used 0x07 for compeleted 128bit UUID, but it can broadcast any more.

Thanks!

Joacimwe
Offline
Last seen:1 year 5 months ago
Guru
加入:2014-01-14 06:45
If you use the latest SDK

If you use the latest SDK this should work.
The type value for 128 bit uuid service data is 0x21. It should contain first 16 bytes of the UUID, then any custom data you want.
Beware though that some budget Android phones using MediaTek bluetooth bail out when they're receive an advertisement containing this data (the received scanRecord array is bogus).
You'd better use the manufacturer specific data.