This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to send 4 byte variable in a beacon advertising packet

Hello, i use ibeacon example, this is the reader advertising packet, he has 31 byte long:

0201041AFF590002150112233445566778899AABBCCDDEEFAB010200FFC300

in this packet i have the uuid, major, minor, flags, tx power, etc...

this packet structure complain with the apple Defined iBeacon Data en.wikipedia.org/.../IBeacon

this packet has the maximun 31 bytes of advertising packet...

i can advertising a packet with a defined structure, for example eliminating uuid, major, minor bytes to insert data variables???

Best Regards

Nelson

  • Theoretically you can do whatever you want. It only depends on what compliance you want to break and what not. If you want to stay Apple iBeacon compliant then you basically have only 16-byte UUID (which should correspond to "service" you register on listener side) and 4 bytes of minor+major version fields. If you don't care about Apple packet formats then you can define "Manufacturer Specific" AD object which will give you typically up to 26 bytes to stay BLE GAP compliant. If you don't care about GAP then you can go up to 31 bytes (in BT 4.0/4.1/4.2 while BT5 introduced even longer packets) and if you don't care about BLE at all (you want just to send something on 2.4GHz ISM band) then you can define your own protocol with even bigger payload.

  • About with the power consumption, if i reduce the number of bytes transmited (payload or headers) the power consumption decrease, it's correct??

  • Yes, power consumption is linked to number of bytes sent in advertising packet. However there is so much overhead and fixed "cost" phases in adv. event on Broadcaster/Peripheral side that you can count only with single digit percentage savings even if you reduce adv. packet to absolute minimum. See section 18.1 of S132 Soft Device Specification for more details. Even without all the timings and power consumption numbers in each phase you can see that just length of Tx phase isn't the main part of the event.

Related