[mono-android] Bluetooth rfcomm

Jonathan Pobst monkey at jpobst.com
Tue Feb 7 15:12:13 UTC 2012


Not sure if it helps, but we have a sample that uses bluetooth:

https://github.com/xamarin/monodroid-samples/tree/master/BluetoothChat

Jonathan


On 2/7/2012 8:40 AM, ledz wrote:
> 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.
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>



More information about the Monodroid mailing list