Re: Extracting iBeacon Advertisement Packets


Martin <ma@...>
 

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 kontakt.io article. Hope this helps anyone...

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

Hi,
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 https://support.kontakt.io/hc/en-gb/articles/201492492-Advertising-packet-structure).
Can someone point me to a direction (function) to do this?

Thanks,
Martin



Join devel@lists.zephyrproject.org to automatically receive all group messages.