您知道如何在移动设备上编码BLE5功能吗?

时间:2018-11-07 13:51:15

标签: bluetooth-lowenergy core-bluetooth android-bluetooth ios-bluetooth

我正在寻找使用BLE5与使用BLE4有何不同。 BLE5向后兼容。但是,如何在Android或IOS上启用2xSpeed,4xRange或LE广告扩展之类的功能?您是否可以建议任何教程或代码示例开始?

2 个答案:

答案 0 :(得分:2)

据我所知,iOS尚不以编程方式支持Bluetooth 5功能。但是,如果两个设备都支持此功能,则Bluetooth 5设备可以自动启动向2MPHY的切换。您可以找到有关此here的更多详细信息。默认情况下,在支持Bluetooth 5的Android设备上也可以使用此功能,但是我找不到对此的任何引用。

对于Android API,Android 8引入了Bluetooth 5功能。有关此API,请参见:-

还有更多用于蓝牙5控制的API,但这应该可以帮助您入门。

您可以在以下位置找到更多信息:-

  1. CoreBluetooth Programming Guide
  2. Android Bluetooth API
  3. Android API Reference for Bluetooth
  4. Android API Reference for Bluetooth LE

我希望这会有所帮助。

答案 1 :(得分:0)

在Android上,从API 26开始,您可以使用 using namespace std::chrono; high_resolution_clock::time_point t = high_resolution_clock::now(); //... do what is to be measured high_resolution_clock::time_point t2 = high_resolution_clock::now(); cout << duration_cast<milliseconds>(t2 - t).count(); 函数来使用扩展广告,另请参见docs

相关问题