android-platform
[Prev] Thread [Next] | [Prev] Date [Next]
Re: Request For Comment: Bluetooth Socket API (RFCOMM, SPP, L2CAP, SCO) Nick Pelly Fri Jun 26 16:00:34 2009
On Wed, Jun 24, 2009 at 3:11 PM, Martin Nielsen <[EMAIL PROTECTED]>wrote: > > Hi Nick > > Given the discussion about simplifying the API I thought about the > parameters for the functions above. One idea could be to change the > API to something like this: > > public static BluetoothSocket createRfcommSocket(String address, > String serviceUuid) throws IOException; > public static BluetoothSocket createInsecureRfcommSocket(String > address, String serviceUuid) throws IOException; > public static BluetoothSocket createScoSocket(String address) throws > IOException; > public static BluetoothSocket createL2capSocket(String address, String > serviceUuid) throws IOException; > public static BluetoothSocket createInsecureL2capSocket(String > address, String serviceUuid) throws IOException; Neat idea (although prefer java.util.UUID not String), We would have to perform the SDP lookup during connect(). It does have the slight disadvantage of making it hard to disambiguate 'SDP lookup successful but RFCOMM connection failed' from 'SDP failed'. > > The channel and psm is basically changed to a uuid 128 bit hiding the > operations required to perform the SDP lookup. > > Something similar could also be done with the server APIs like: > > public static BluetoothServerSocket listenUsingRfcommOn(String > serviceUuid) throws IOException; > public static BluetoothServerSocket listenUsingInsecureRfcommOn(String > serviceUuid) throws IOException; > public static BluetoothServerSocket listenUsingL2capOn(String > serviceUuid) throws IOException; > public static BluetoothServerSocket listenUsingInsecureL2capOn(String > serviceUuid) throws IOException; > public static BluetoothServerSocket listenUsingSco() throws > IOException; > > I'm not sure if this would work since it would require the class to > register an SDP record exposing the service. Need to have a look at > the spec to see if it is possible. The downside of the change on the > server side is that you can't register a complex SDP record. > > This could also be made as an abstraction on top of the > BluetoothSocket layer. > > Regards > Martin > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "android-platform" 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-platform?hl=en -~----------~----~----~----~------~----~------~--~---
- Re: Request For Comment: Bluetooth Socket API (RFCOMM, SPP, L2CAP, SCO), (continued)
Re: Request For Comment: Bluetooth Socket API (RFCOMM, SPP, L2CAP, SCO) xiaoming gu Re: Request For Comment: Bluetooth Socket API (RFCOMM, SPP, L2CAP, SCO) Martin Nielsen Re: Request For Comment: Bluetooth Socket API (RFCOMM, SPP, L2CAP, SCO) Martin Nielsen