Re: Extracting iBeacon Advertisement Packets

Luiz Augusto von Dentz

Hi Martin,

There is an API to help parsing advertisements:

It will call the callback given for each data type found, for instance
the sample on the site has flags + manufacturer data, you probably are
only interested in the second. You can also parse the UUID using:

On Thu, Nov 22, 2018 at 12:50 AM Martin <ma@...> wrote:

Sorry, I was copying the wrong code..

int i;

//print adv. packet
for(i=0;i<buf->len;i++) {
printk("%d %02X\n",i, buf->data[i]);

//print major
printk("maj: %d\n",((buf->data[25] & 0xff) * 0x100 + (buf->data[26] & 0xff) ));
Am Mi., 21. Nov. 2018 um 18:12 Uhr schrieb Martin <ma@...>:

Well, simple enough.

int i;

for(i=0; i<5; i++) {
printf("i%d\n", i+1);

prints the advertisement packet's bytes in decimals and includes the
UUID acc. to the article. Hope this helps anyone...

Am Mi., 21. Nov. 2018 um 17:56 Uhr schrieb Martin <ma@...>:

I am quite new to Zephyr and want to extract iBeacon Advertisement
Packets. I already have access to them as a net_buf_simple structure,
but I want to read the major and minor for example. I realize that I
have to probably read some certain bytes out of net_buf_simple
(according to
Can someone point me to a direction (function) to do this?


Luiz Augusto von Dentz

Join to automatically receive all group messages.