locked
Not able to send data to bluetooth device through serial port profile

    Question

  • Hi,

    We're writing a Windows desktop application in C# to connect to a Bluetooth device from Windows tablet and send some data over the serial port profile. We are able to discover the device asynchronously, pair the device and connect to it. But when it comes to send data, we are getting socket exception saying: "This operation is not allowed on a non-connected socket.". From what we could find out is that, the client is going back to not connected state before we are sending the data.

    We tried manually to pair and connect to the Bluetooth device from the tablet, then also we are seeing the same behavior. We could see the device as Connected for 1-2 seconds and then it comes as Not Connected.

    We also tried to send some files between two Windows tablets via Bluetooth. In this case also, the behavior was the same. We observed the same behavior with Android smartphones also.

    We could see the same issue even after unchecking the Power Management option, "Allow the computer to turn off this device" under Device Manager > Bluetooth Radio and restarting the system.

    Please help.

     

    Tuesday, December 23, 2014 9:38 AM

All replies

  • Just to be clear - are you using WinRT or standard .NET APIs?


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, December 23, 2014 7:04 PM
    Moderator