[mono-android] Bluetooth rfcomm

ledz goncalo at minkan.net
Tue Feb 7 14:40:55 UTC 2012


I'm having some trouble on using bluetooth with rfcomm on a custom device. I
am able to connect the socket, it seems, but I can't retrieve anything from
the output stream; just keep on getting an io exception and the connection
drops. Can someone give me a few pointers if I'm doing anything wrong, or if
there are any exceptions where this won't work?

I'm basically connecting through a RfcommSocketToService

private UUID ServiceUUID = UUID.FromString(
"00001101-0000-1000-8000-00805F9B34FB" );
...
socket = device.CreateRfcommSocketToServiceRecord( ServiceUUID );
...
StreamReader reader = new StreamReader( socket.InputStream );
...
int n = reader.ReadBlock( buffer, 0, buffer.Length );


I'm running this over an Android 2.3.6 smartphone (Samsung GT-N7000).
I posted a sample of my code here: http://pastebin.com/j9MmdDwQ

Cheers


--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/Bluetooth-rfcomm-tp5463305p5463305.html
Sent from the Mono for Android mailing list archive at Nabble.com.


More information about the Monodroid mailing list