BLE peripheral support Android-L example [closed]

老子叫甜甜 提交于 2019-12-22 10:17:26

问题


I would appreciate an example of BLE peripheral mode for Android-L.

The code that I have gives me strange errors (i.e too many advertisers) which makes no sense as there are no advertisers that i can see from scanner like Lightblue on ios.


回答1:


https://github.com/geoaxis/BluetoothTest works on my nexus 5 running L.

At first when initializing advertising I was getting: public static final int ADVERTISE_FAILED_CONTROLLER_FAILURE

Operation fails due to bluetooth controller failure.

Constant Value: 5 (0x00000005)

I was running other bluetooth apps, I killed all of them, restarted the bluetooth service and got a success. L is still preview, so some loose ends are expected.

geoaxis, thanks for forking, I wouldn't have had the chance to read this very clear sample otherwise; there should such a sample in the L dev preview samples.

cheers




回答2:


It seems that there is a bug for Android-L preview for Nexus 7. Nexus 5 works fine https://code.google.com/p/android-developer-preview/issues/detail?id=589

Example code for nexus 5 can be found here https://github.com/geoaxis/BluetoothTest




回答3:


BLE peripheral mode for Android is expected in android version 4.5



来源:https://stackoverflow.com/questions/24615941/ble-peripheral-support-android-l-example

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