简体   繁体   English

如何使用bluez API扫描蓝牙低功耗设备

[英]How to scan for Bluetooth low energy devices using bluez API

I'm new in programming Bluetooth low energy using BlueZ. 我是使用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. 我想开发一个本机代码c,使用适用于Android 4.0.3的蓝牙低功耗BlueZ API扫描附近的设备。

Anyone know which BlueZ methods I should use? 有谁知道我应该使用哪种BlueZ方法?

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. 如果您正在寻找编写本机c代码来扫描BLE设备,那么最好的选择是从这里获取bluez包并查看它是如何实现的。 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. 有关扫描设备的信息,请参阅/tools/hcitool.c源文件,特别是函数static void cmd_lescan(int dev_id, int argc, char **argv)并了解如何实现。

I hope this helps. 我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM