Make communication between 2 android phones over BLE

こ雲淡風輕ζ 提交于 2019-12-01 07:36:34

问题


I have two android smartphones (Xperia Z and Xperia Z1) and both have BLE capability.

Can I connect to one of them as a peripheral over BLE? In my application I can see and conenct a BLE as peripheral (CC2541 device) and I can see all sevices and characteristics. But same application can not see one of my phones??

Is there a way to achice that??


回答1:


As of Android 4.4 there is no support for peripheral mod in the Android BLE apis. You would need this to be able to make two phones talk over BLE setting one up as a peripheral and the other as central.

There is a feature request for the feature you may want to take notice of.

If you just want to be able to get the two phones connecting there is nothing stopping you from using classic Bluetooth which should be perfectly workable.




回答2:


Android does not support peripheral mode till version 5.0(latest version) therefore you can not communicate with two smartphone over BLE.

You can communicate over BLE with sensor device and smart phone here smartphone app works as client and senser device as a server.

and if you want to communicate between two smartphone you have to use classic bluetooth.



来源:https://stackoverflow.com/questions/20799280/make-communication-between-2-android-phones-over-ble

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