Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scan for Bluetooth low energy devices using bluez API

I'm new in programming Bluetooth low energy using BlueZ.

I want to develop a native code c to scan nearby devices using a BlueZ API for Bluetooth low energy under Android 4.0.3.

Anyone know which BlueZ methods I should use?

like image 872
user3432104 Avatar asked Mar 18 '14 09:03

user3432104


1 Answers

If you're looking to write native c code to scan BLE devices, your best option would be to get the bluez package from here and look at how that is implemented. For scanning for devices, see the /tools/hcitool.c source file, specifically the function static void cmd_lescan(int dev_id, int argc, char **argv) and understand how that is implemented.

I hope this helps.

like image 160
Youssif Saeed Avatar answered Oct 26 '22 10:10

Youssif Saeed