使用c#

时间:2019-04-09 08:15:33

标签: c# .net

我正在使用Lecia Disto e7100i,它基本上是使用激光测量距离和面积的。此设备具有蓝牙功能,可以与Windows配对。 我正在尝试开发一个wpf应用,该应用使用c#读取测量的数据。

设备没有附带sdk。 我尝试使用32feet.Net,但是由于没有适当的文档,我不知道从哪里开始。

有什么办法可以解决我的问题?

3 个答案:

答案 0 :(得分:1)

要开始使用,您可以尝试:

var client = new BluetoothClient();
// Select the bluetooth device
var dlg = new SelectBluetoothDeviceDialog();
DialogResult result = dlg.ShowDialog(this);
if (result != DialogResult.OK)
{
    return;
}
BluetoothDeviceInfo device = dlg.SelectedDevice;
BluetoothAddress addr = device.DeviceAddress;
Console.WriteLine(device.DeviceName);
BluetoothSecurity.PairRequest(addr, "PIN"); // set the pin here or take user input
device.SetServiceState(BluetoothService.HumanInterfaceDevice, true);
Thread.Sleep(100); // Precautionary
if (device.InstalledServices.Length == 0)
{
    // handle appropriately
}
client.Connect(addr, BluetoothService.HumanInterfaceDevice);

还要确保

  • 设备出现在“控制面板”中的“蓝牙设备”中。
  • 设备为HID或相应地更改代码。

希望有帮助。干杯!

答案 1 :(得分:0)

尝试this演示项目,然后尝试下一篇文章。

尝试遵循this tutorial

Here,您可以看到32feet的管理员的直接回答,您可以与之取得联系

还要检查this答案

答案 2 :(得分:0)

这不是完整的答复,而是更多有关如何解决问题的指南:

  1. 将设备与计算机配对
  2. 运行随附的软件,以某种方式显示数据
  3. 使用WireShark分析流量
  4. 查看它是标准协议类型还是自定义类型
  5. 了解协议并使用c#和BluetoothSockets
  6. 重新实现