Advertisement with Service UUID, Local Name and manufacturing Data

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am trying to advertise the following data

adv[0].len     = 16+1;

adv[0].val     = ADV_SERVICE_UUID128_COMP; // (AD_TYPE == 0x07)

BT_MEMCPY(&adv[0].data, vendor_service_uuid, 16);

adv[1].len     = 10+1;

adv[1].val     = ADV_LOCAL_NAME_COMP;

BT_MEMCPY(&adv[1].data[0], local_name, 10);

adv[2].len     = 1+1;

adv[2].val     = ADV_MANUFACTURER_DATA; // (AD_TYPE == 0xff)

adv[2].data[0] = variable & 0xFF;

But it only advertises ADV_SERVICE_UUID128_COMP and ADV_LOCAL_NAME_COMP, I can not see the manufacturing data.

The total length here is 17+11+2 = 30 bytes.

Any suggestion on why I can't see the manufacturing data?

0 Likes
1 Solution

Extra & in && looks like a bug as well

View solution in original post

0 Likes
5 Replies
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received

maybe the problem is adv[2].data[0] = variable && 0xFF;

0 Likes

also your math is not correct.  the length of your data is 33 which does not fit.  Over the air it goes Length Type Data.  So if data is 16 octets in length this portion of advertisement data taks 1 + 1 + 16 = 18.

0 Likes
Anonymous
Not applicable

That makes it clear, 33 bytes is my length and hence the isue. Thanks!

0 Likes

Extra & in && looks like a bug as well

0 Likes
Anonymous
Not applicable

That was a typo!

0 Likes