I have a problem when I trying to connect with pebble watch via bluetooth. This is my code:
var serviceId = Guid.Parse("00001101-0000-1000-8000-00805F9B34FB").ToString("B");
PeerFinder.Start();
PeerFinder.AlternateIdentities["Bluetooth:Paired"] = "";
var pairedDevices = await PeerFinder.FindAllPeersAsync();
PeerInformation selectedPeer = pairedDevices[0];
var streamSocket = new StreamSocket();
await streamSocket.ConnectAsync(selectedPeer.HostName, serviceId);
Also in manifest:
<Capabilities>
<Capability Name="internetClientServer" />
<Capability Name="privateNetworkClientServer" />
<DeviceCapability Name="proximity" />
<m2:DeviceCapability Name="bluetooth.rfcomm">
<m2:Device Id="any">
<m2:Function Type="serviceId:00001101-0000-1000-8000-00805F9B34FB"/>
</m2:Device>
</m2:DeviceCapability>
</Capabilities>
So the exception throws in await streamSocket.ConnectAsync(selectedPeer.HostName, serviceId);
.
Exception: Element not found. (Exception from HRESULT: 0x80070490)
I have already seen same questions but I didn't find a solution of the problem.
Thanks.
I found a solution, just replace service id by 00000000-deca-fade-deca-deafdecacaff
User contributions licensed under CC BY-SA 3.0