2

I'm querying the Nexus One for UUIDs using the getUuids() call from my Android App and I'm seeing the following being returned:

 0 th UUID found is 00001105-0000-1000-8000-00805f9b34fb
 1 th UUID found is 00001106-0000-1000-8000-00805f9b34fb
 2 th UUID found is 0000110a-0000-1000-8000-00805f9b34fb
 3 th UUID found is 0000110c-0000-1000-8000-00805f9b34fb
 4 th UUID found is 00001112-0000-1000-8000-00805f9b34fb
 5 th UUID found is 0000111f-0000-1000-8000-00805f9b34fb
 6 th UUID found is 0000112f-0000-1000-8000-00805f9b34fb
 7 th UUID found is 00001200-0000-1000-8000-00805f9b34fb

My question is: Why am I not able to see the standard UUID for SPP (00001101-0000-1000-8000-00805f9b34fb) in this list?

I have tested that I'm able to send serial data from an android device(Xoom) to this Nexus One phone using the S2 Bluetooth Terminal app. What UUID is being used in this data transfer?

KingCrunch
  • 128,817
  • 21
  • 151
  • 173

1 Answers1

1

The S2 Bluetooth Terminal application uses 00001101-0000-1000-8000-00805F9B34FB hardcoded (checked with smali).

Mind the following:

  • looking at the docs for getUuids() I've noticed that:

    This method does not start a service discovery procedure to retrieve the UUIDs from the remote device. Instead, the local cached copy of the service UUIDs are returned. Use fetchUuidsWithSdp() if fresh UUIDs are desired.

    Have you tried fetchUuidsWithSdp()?

  • S2 Bluetooth Terminal, while useful, is not really a tool for SDP debugging. Personally, I'd rather try using BlueZ utilities (or something similar, if on Windows - yet I'd recommend Linux here) to see what services are actually advertised by the device. This way you'd be able to (at least) narrow down the problem to one of the devices.

    Edit: on Windows you can use Bluetooth Network Scanner

Here's a small sample of how can you scan the services with BlueZ tools (GPS receiver used for this sample):

czajnik@lapcio:~$ hcitool scan
Scanning ...
    00:1C:88:11:0E:CC   PENTA-GPS
czajnik@lapcio:~$ sdptool  browse 00:1C:88:11:0E:CC
Browsing 00:1C:88:11:0E:CC ...
Service Name: SPP Slave
Service RecHandle: 0x10000
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Code Painters
  • 7,175
  • 2
  • 31
  • 47
  • Thank you @CodePainters. I was able to verify that the standard SPP UUID is not being advertised for this phone using fetchUuidswithSdp(). How is the Xoom able to send data to the Nexus device through S2 Bluetooth Terminal. It is using some other Bluetooth Profile? – user1102412 Oct 10 '12 at 05:15
  • That's a good question, indeed. But again - I'd eliminate Android client first, and use my PC to scan the service list to see what's really advertised. The fetchUuidswithSdp() not returning your service is not enough to say that the service is not advertised - it may be a bug on the client side. If you're on Windows, try this: http://www.medieval.it/bluescan-pc/menu-id-72.html – Code Painters Oct 10 '12 at 07:50
  • Also, you may find this useful: http://stackoverflow.com/questions/9405575/android-bluetooth-sdp-does-not-recognize-service-advertised-in-javame – Code Painters Oct 10 '12 at 07:51
  • Another thought: have you tried calling `createRfcommSocketToServiceRecord()` or `createInsecureRfcommSocketToServiceRecord()` directly? That's what `S2 Bluetooth Terminal` does, it never scans for advertised UUIDs. – Code Painters Oct 10 '12 at 07:57
  • Thank you once again, @CodePainters. The 'bluescan' software was a good suggestion. I installed it on windows and verified that the standard SPP UUID the 1101-xxxx-.... was missing from the list and that the list was identical to what I have pasted in my original question. I have tried calling createRfcommSocketToServiceRecord() directly and this proved to be of no use as well. I will not try to see if the SPP UUID is nested as an attribute or something under the list of UUIDs given above. – user1102412 Oct 11 '12 at 05:14