Re: Get the raw Bluetooth Low Energy advertising data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> I am trying to get raw BLE advertising information using Bluez tool
> such as hcitool in a quick and dirty way. Someone (in this post
> http://comments.gmane.org/gmane.linux.bluez.kernel/43422) modified the
> "print_advertising_devices" function in "tools/hcitool.c", and he
> claimed successfully printing out the advertising data from command
> "sudo hcitool lescan". The "hcitool.c" can be conveniently viewed here
> http://git.kernel.org/cgit/bluetooth/bluez.git/tree/tools/hcitool.c .
> I guess the pointer "info" with type of "le_advertising_info" (defined
> in "lib/hci.h") in  "print_advertising_devices" function has all
> advertising information . A closer look into the struct definition
> 
> typedef struct {
> uint8_t evt_type;
> uint8_t bdaddr_type;
> bdaddr_t bdaddr;
> uint8_t length;
> uint8_t data[0];
> } __attribute__ ((packed)) le_advertising_info;
> 
> reveals that the data array has zero length. In that case, where is
> the advertising data?

you might need to brush up your knowledge about what zero length data fields mean in a C struct ;)

However I would not advice in doing such a quick and dirty hack. The D-Bus API gives full access to advertising data in the latest version. So you should really use that. Trying to get LE Advertising Report HCI events parsed correctly is harder than you think. So unless you really grok the Bluetooth Core specification, I would not go there.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux