So there is port emulation you can use if you use reflection, but it's kind of wacky and doesn't really work like vanilla TCP: so it's helpful not to think of it that way. You can read about it here:
http://www.palowireless.com/infotooth/tutorial/rfcomm.asp#Port%20Emulation%20Entity%20:%20Serial%20Flow%20Control But still, in this example, I'm not sure why you'd want it? kris On Thu, Feb 14, 2013 at 10:10 AM, bob <[email protected]> wrote: > Yes, you can specify ports, but I think you may have to use Reflection on > Android. > > > This will give you a connection to port 17: > > > BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); > > BluetoothDevice device = adapter.getRemoteDevice(address); > > Method m = device.getClass().getMethod("createInsecureRfcommSocket", new > Class[] { int.class }); > > socket = (BluetoothSocket) m.invoke(device,Integer.valueOf(17)); > > socket.connect(); > > On a Windows server, you would change BT_PORT_ANY to a number between 1 and > 30. > > There is more info here: > > http://msdn.microsoft.com/en-us/library/windows/desktop/aa362899(v=vs.85).aspx > > "The valid range for requesting a specific RFCOMM port is 1 through 30." > > > > > On Thursday, February 14, 2013 3:56:41 AM UTC-6, tom_mai78101 wrote: >>> >>> The UUID just says what port the Bluetooth Server is on. I could have a >>> server running on Bluetooth port 1. >> >> >> Does this imply there's a way to specify different Bluetooth ports, if the >> port(s) exists? I have never heard of Bluetooth using ports like TCP. If >> you're just making an example, then please disregard this and above. > > -- > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Android Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

