2

I'm developing a Windows phone 8 OS application which should connect to the Bluetooth device (by id/ name).

I tried to use by PeerFinder.FindAllPeersAsync() to find all the active devices and I got the following error:

A method was called at an unexpected time. (Exception from HRESULT: 0x8000000E).

How can I connect to Bluetooth? What do I need to do?

Is it possible?

I need the answer ASAP.

Thank a lot

2 Answers 2

1

Had the same problem and couldn't find anyone with a solution. After an hour or so of trial and error I have come up with the following:

  1. You need to call PeerFinder.Start() before PeerFinder.FindAllPeersAsync() or you will get the error "A method was called at an unexpected time" (which is caught in Microsoft's sample application "Bluetooth app to app sample" - ERR_NOT_ADVERTISING = 0x8000000E).

  2. But after saying all that I couldn't find any Bluetooth devices. The only way I worked out how to connect to a Bluetooth device was to pair using the control panel and then use PeerFinder.AlternateIdentities["Bluetooth:Paired"] = string.Empty; Now this didn't seem to require PeerFinder.Start() to return results but if you don't do it you will get exceptions later on.

I couldn't find information about this on the Microsoft API's - it seems like these API's are unpolished.

0

WP8 supports the RFCOMM Bluetooth profile. This is a serial emulation profile. So in theory, any Bluetooth device that can be paired via RFCOMM should work.

Bluetooth for Windows Phone 8

Developer Code Samples (Phone + Bluetooth)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.