首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >rfComm蓝牙连接胰岛素泵

rfComm蓝牙连接胰岛素泵
EN

Stack Overflow用户
提问于 2019-09-27 22:36:19
回答 1查看 62关注 0票数 0

通过rfComm协议实现与胰岛素泵的32feet.Net连接。我写了一个简单的代码来连接

代码语言:javascript
复制
   public void Listen()
    {
         server = new BluetoothListener(mUUID) { ServiceName =  "SerialLink" };
         Console.WriteLine("Start listen Devices");
         Console.WriteLine(server.LocalEndPoint.ToString());
         server.Start();
         while (true)
         { 
           using(BluetoothClient ConnectedClient = server.AcceptBluetoothClient())
            {
                //...
            }
        }

    }

Pump after start此代码会被windows检测到,但windows t want to give a ConnectedClient callback, blocks it by the message asking to type pin-code. The main trick that it won不会提供帮助,因为在窗口消息中键入PIN码并发送到pump后,我必须附加hello-byte,然后她知道连接是稳定的。阅读32英尺长的Api我试图在Windows UWP中使用现代的rfComm Api,但它不想搜索我的胰岛素泵。代码如下:

代码语言:javascript
复制
public async void InitializeRfCommServer()
        {
            try
            {
                rfcommProvider = await 
                RfcommServiceProvider.CreateAsync(RfcommServiceId.FromUuid(RfcommServiceUuid));

                // Create a listener for this service and start listening
                socketListener = new StreamSocketListener();
                socketListener.ConnectionReceived += SocketListener_ConnectionReceived;

                await socketListener.BindServiceNameAsync(rfcommProvider.ServiceId.AsString(),
                   SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication);

                rfcommProvider.StartAdvertising(socketListener,true);

                TextLabel.Text = "Listening for incoming connections";
                ServerInitiated = true;

            }
            catch (Exception e)
            {
                TextLabel.Text = e.Message;

                ServerInitiated = false;
            }
       } 

所以我很困惑。可能是Windows 7中的试用32英尺库?或者尝试纠正UWP代码?

EN

回答 1

Stack Overflow用户

发布于 2019-09-30 14:52:34

您是否已使用windows上的wireshark数据包分析器确认未进行搜索?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58136670

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档