蓝牙监听器

时间:2017-01-04 09:31:09

标签: c# bluetooth 32feet

我正在使用InTheHand.Net.Personal(32feet.NET)库进行c#,我进行了直接连接(没有Seri​​ar COM端口),我可以向设备发送命令:

String address = "XX:XX:XX:XX:XX:XX"; 
Guid mUUID = new Guid("00001101-0000-0000-0000-000000000000");

BluetoothAddress addr = BluetoothAddress.Parse(address);
var btEndpoint = new BluetoothEndPoint(addr, mUUID);
var btClient = new BluetoothClient();
btClient.Connect(btEndpoint);

Stream peerStream = btClient.GetStream();

StreamWriter sw = new StreamWriter(peerStream);
sw.WriteLine("Hello World");
sw.Flush();
sw.Close();

btClient.Close();
btClient.Dispose();
btEndpoint = null; 

但是,我需要从设备上异步回复。但是,我不知道InTheHand.Net.Personal库使用什么方法。无论如何要附加任何听众或类似的人?

0 个答案:

没有答案