How to scan for Bluetooth low energy devices using bluez API

試著忘記壹切 提交于 2019-12-06 04:00:01

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/22474714/how-to-scan-for-bluetooth-low-energy-devices-using-bluez-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!