Bluetooth set RfComm channel

680 views
Skip to first unread message

Gorka

unread,
May 13, 2010, 5:45:54 AM5/13/10
to android-platform
Hi,

I am trying to connect my Bluetooth device with an application running
on my laptop. The problem I have is that this application (I can not
change it) only accepts connections on a certain RfComm channel. When
I create my server socket using listenUsingRfcommWithServiceRecord it
creates the service in a random channel. What I am doing right now is
to create many services, 6 for example, and hope that one of them is
created on the channel 8. Is it possible somehow to indicate or force
the channel where the SDP service is going to be offered??

Thanks, Gorka

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

Pavan Savoy

unread,
May 14, 2010, 12:32:41 AM5/14/10
to android-...@googlegroups.com
I think so yes.
That is how obex does and pbap does in android both force themselves
to listen onto 12 and 19 respectively ...
you can check their source code...
--
--Pavan Savoy

Arun Kumar

unread,
May 17, 2010, 12:24:31 AM5/17/10
to android-...@googlegroups.com
Dear Gorka,

You should be able to check the relevant BT service and thier port numbers in your init.rc file. this is where all BT services are autoluanched via sdptool with user/group as Bluetooth.

for most part. rfcomm port numbers are mostly reserved ..viz ftp 21, opp as 19 etc.. but init.rc is a good starting point to understand same.

thanks,
Arun
--
Regards,
Arun
Reply all
Reply to author
Forward
0 new messages