如何使用的bluez API来扫描蓝牙低功耗设备 [英] How to scan for Bluetooth low energy devices using bluez API
问题描述
我是新编程蓝牙低能量使用的BlueZ。
I'm new in programming Bluetooth low energy using BlueZ.
我想开发一个原生codeC的Android 4.0.3下使用扫描蓝牙低能量的BlueZ API附近的设备。
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.
任何人都知道我应该使用哪种方法的BlueZ?
Anyone know which BlueZ methods I should use?
推荐答案
如果你正在寻找编写本地C code扫描BLE的设备,最好的办法是得到的bluez包从的here 看看该如何实现。对于扫描设备,请参阅该/tools/hcitool.c源文件,特别是函数的静态无效cmd_lescan(INT的dev_id,INT ARGC,字符** argv的)
和理解该实施
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.
我希望这有助于。
这篇关于如何使用的bluez API来扫描蓝牙低功耗设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!