How to connect to another device through Bluetooth and send some data and receive acknowledgement back- Xamarin

隐身守侯 提交于 2021-02-11 15:14:19

问题


I'm developing a Xamarin application using Visual Studio 2019. I have to connect to another device through Bluetooth and send some data and receive acknowledgment back. Tried this samples out

But didn't help me while connecting for nearby Bluetooth devices, since the below codes are not giving expected results.

bluetoothTxSocket = bluetoothDevice.CreateRfcommSocketToServiceRecord(UUID.FromString("00001101-0000-1000-8000-00805f9b34fb"));
bluetoothTxSocket.Connect();

Getting below exception after executing the last line Java.IO.IOException

Message=read failed, socket might closed or timeout, read ret: -1. Can anyone help me out?

Does above code supports only to connect Classic Bluetooth Devices? What I have to do, if I need to connect to BLE devices..

来源:https://stackoverflow.com/questions/62371859/how-to-connect-to-another-device-through-bluetooth-and-send-some-data-and-receiv

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