2015-10-12 73 views
2

我正在开发Windows 8.1的通用应用程序。我的应用程序使用的蓝牙设备,手机完美的作品,但在平板电脑上我有错误,同时连接到设备:Winrt蓝牙错误

请求的地址不在其上下文(0x80072741)

这里我的代码有效:

 await 
      streamSocket.ConnectAsync(
       new HostName(info.Id), 
       "{00001101-0000-1000-8000-00805F9B34FB}"); 
     dataReader = new DataReader(streamSocket.InputStream); 
     dataWriter = new DataWriter(streamSocket.OutputStream); 

能力:

<DeviceCapability Name="proximity" /> 
    <m2:DeviceCapability Name="bluetooth.rfcomm"> 
     <m2:Device Id="any"> 
     <m2:Function Type="name:serialPort" /> 
     </m2:Device> 
    </m2:DeviceCapability> 

回答

0

因为它是RT,你并不孤单!

请转到帖子#357:https://forums.getpebble.com/discussion/8077/windows-phone-8-pebble-app/p5 ..我认为这会有所帮助!

+0

如果我理解正确,建议使用RfcommDeviceService。但是在这个服务中有一些错误。这就是我使用StreamSockets的原因。在我使用它之后,WIndowsPhone上的所有错误都已修复。 – Vitaliy

+0

如果它对您有用,此代码在Windows 10上完美运行。这就是为什么我们决定停止支持Windows 8.1平板电脑 – Vitaliy