locked
Bluetooth connection failed, supportedDiscoveryTypes is 0

    Question

  • I was just wondering if someone has a working example for a Bluetooth P2P connection for Windows 8 (in Javascript)? I just wanna create a simple multiplayer-game, but I fail at the very beginning.
    Here is the sample code, lightly adopted from the Devcenter:

            var peerFinder = Windows.Networking.Proximity.PeerFinder;
            peerFinder.displayName = “sample”;
            peerFinder.allowBluetooth = true;
    
            console.log(peerFinder.supportedDiscoveryTypes);
    
            if (peerFinder.supportedDiscoveryTypes & Windows.Networking.Proximity.PeerDiscoveryTypes.triggered) {
            //Do the connection stuff
            } else {
     //No devices found
            }
    


    I can see in the console, that supportedDiscoveryTypes is 0 and I don’t know why. My Bluetooth device is active and working (I can send and receive files from my phone).
    What do I have to do, to establish a working Bluetooth connection?

    Thanks in advance for any help or hints!
    Cheers
    Chris

    Monday, June 10, 2013 4:09 PM

Answers

  • Hi Chris,

    Windows Store apps don't support direct Bluetooth connections. You need NFC or WiFi direct to set up the connection. Since your system doesn't have those, supportedDiscoveryTypes is 0 and you cannot use PeerFinder.

    --Rob 

    Tuesday, June 11, 2013 2:54 PM
    Owner

All replies

  • Hi Chris,

    Windows Store apps don't support direct Bluetooth connections. You need NFC or WiFi direct to set up the connection. Since your system doesn't have those, supportedDiscoveryTypes is 0 and you cannot use PeerFinder.

    --Rob 

    Tuesday, June 11, 2013 2:54 PM
    Owner
  • Ok, that's good to know, however it's a pity Microsoft didn't implement this feature.
    Wednesday, June 12, 2013 8:51 AM