4

I am using Xamarin.Android to connect to a Bluetooth device that uses the serial port profile to transmit to an optical sensor. The device is geared toward being used with Windows through a com port, however, it is (supposed) to be able to work with any Bluetooth device.

I can set up the device and connect to it fine using CreateRfcommSocketToServiceRecord(), and don't have any problems with pairing.

However, when I connect to the device socket, it immediately begins receiving 0xFFs from the Bluetooth connection even though nothing has been written to the output stream. I can write properly to the output stream and read from the other end, but the flow of 0xFFs does not stop until I close the socket.

I have used several native Android apps to connect to the device and they also have this issue.

When I connect to the device over Windows through a com port, the device transmits and receives data normally without any problems.

Has anyone else ever experienced this problem with a Bluetooth-serial adapter before on Android - and if so, was there a solution?


The spec sheet for the device can be found here: http://www.probe-tec.com/Documents/997-419%20Probe-Tec%20Product%20Sheet%20(2).pdf (It is intended to communicate with smart power meters.)

Sachin Joseph
  • 15,841
  • 3
  • 36
  • 54
  • I've also developed a Xamarin/Android app that creates an SPP Bluetooth connection, and I've tested it on several different Android devices. I've never seen the behavior that you describe, but I have seen strange things happen on some devices that doesn't occur on others. How many android devices have you tested it with? – Greg Ferreri Mar 29 '15 at 20:03

0 Answers0