michelcandido / btstack

Automatically exported from code.google.com/p/btstack
0 stars 0 forks source link

Generating SDP Records - Glitches #144

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When creating records in btstack and then viewing them with 'sdptool browse 
--tree --l2cap ....' there are some records which don't show correctly (or at 
least the same as Bluez provides).

UINTs are displayed as 'integer', not UINT8/UINT16/UINT32 as under Bluez
--
    de_add_number(sppServiceRecord, DE_UINT, DE_SIZE_16, SDP_ServiceAvailability);
    de_add_number(sppServiceRecord, DE_UINT, DE_SIZE_8, 0xFF);
--
Attribute Identifier : 0x8 - ServiceAvailability
  Integer : 0xff
--

Strings shows a list on uchars, rather than strings
--
    de_add_number(sppServiceRecord, DE_UINT, DE_SIZE_16, 0x0101);
    de_add_data(sppServiceRecord, DE_STRING, 4, (uint8_t *)"COM1");
--
Attribute Identifier : 0x101
  Data : 43 4f 4d 31 00
--

I have attached the record I expect to see/am trying to copy, generated by 
adding a single SP to hci0 in Bluez.

Cheers,
Simon.

full output below
--
simon@womble:~/btstack-svn/include/btstack$ sdptool browse --tree --l2cap 
00:0F:B3:99:6B:CC
Browsing 00:0F:B3:99:6B:CC ...
Attribute Identifier : 0x0 - ServiceRecordHandle
  Integer : 0x10003
Attribute Identifier : 0x1 - ServiceClassIDList
  Data Sequence
    UUID16 : 0x1101 - SerialPort
Attribute Identifier : 0x2 - ServiceRecordState
  Integer : 0x1234
Attribute Identifier : 0x3 - ServiceID
  UUID16 : 0x1101 - SerialPort
Attribute Identifier : 0x4 - ProtocolDescriptorList
  Data Sequence
    Data Sequence
      UUID16 : 0x0100 - L2CAP
    Data Sequence
      UUID16 : 0x0003 - RFCOMM
      Channel/Port (Integer) : 0x1
Attribute Identifier : 0x5 - BrowseGroupList
  Data Sequence
    UUID16 : 0x1002 - PublicBrowseGroup
Attribute Identifier : 0x6 - LanguageBaseAttributeIDList
  Data Sequence
    Code ISO639 (Integer) : 0x656e
    Encoding (Integer) : 0x6a
    Base Offset (Integer) : 0x100
Attribute Identifier : 0x7 - ServiceInfoTimeToLive
  UUID32 : 0x0000ffff
Attribute Identifier : 0x8 - ServiceAvailability
  Integer : 0xff
Attribute Identifier : 0x9 - BluetoothProfileDescriptorList
  Data Sequence
    Data Sequence
      UUID16 : 0x1101 - SerialPort
      Version (Integer) : 0x100
Attribute Identifier : 0x100
  Data : 53 65 72 69 61 6c 20 50 6f 72 74 00
Attribute Identifier : 0x101
  Data : 43 4f 4d 31 00
--

Original issue reported on code.google.com by mungew...@gmail.com on 27 Apr 2011 at 7:46

Attachments:

GoogleCodeExporter commented 8 years ago
can you also post a hex dump of the sdp record created with BTstack's SDP 
utils? also, you may tweak that manually for testing -> use hexdump and put 
into an array - I did that while debugging HID descriptors for WeBe++ before.

Original comment by matthias.ringwald@gmail.com on 27 Apr 2011 at 8:58

GoogleCodeExporter commented 8 years ago
Output from de_dump_data_element before it is sent registered
--
type   DES (6), element len 131 
    type  UINT (1), element len  3 , value: 0x00000000
    type  UINT (1), element len  5 , value: 0x00001001
    type  UINT (1), element len  3 , value: 0x00000001
    type   DES (6), element len  6 
        type  UUID (3), element len  3 , value: 0x00001101
    type  UINT (1), element len  3 , value: 0x00000002
    type  UINT (1), element len  5 , value: 0x00001234
    type  UINT (1), element len  3 , value: 0x00000003
    type  UUID (3), element len  3 , value: 0x00001101
    type  UINT (1), element len  3 , value: 0x00000004
    type   DES (6), element len 17 
        type   DES (6), element len  6 
            type  UUID (3), element len  3 , value: 0x00000100
        type   DES (6), element len  8 
            type  UUID (3), element len  3 , value: 0x00000003
            type  UINT (1), element len  2 , value: 0x00000001
    type  UINT (1), element len  3 , value: 0x00000005
    type   DES (6), element len  6 
        type  UUID (3), element len  3 , value: 0x00001002
    type  UINT (1), element len  3 , value: 0x00000006
    type   DES (6), element len 12 
        type  UINT (1), element len  3 , value: 0x0000656e
        type  UINT (1), element len  3 , value: 0x0000006a
        type  UINT (1), element len  3 , value: 0x00000100
    type  UINT (1), element len  3 , value: 0x00000007
    type  UUID (3), element len  5 , value: 0x0000ffff
    type  UINT (1), element len  3 , value: 0x00000008
    type  UINT (1), element len  2 , value: 0x000000ff
    type  UINT (1), element len  3 , value: 0x00000009
    type   DES (6), element len 12 
        type   DES (6), element len  9 
            type  UUID (3), element len  3 , value: 0x00001101
            type  UINT (1), element len  3 , value: 0x00000100
    type  UINT (1), element len  3 , value: 0x00000100
    type STRING (4), element len 13 len 11 (0x0b)
53 65 72 69 61 6C 20 50 6F 72 74 
    type  UINT (1), element len  3 , value: 0x00000101
    type STRING (4), element len  6 len 4 (0x04)
43 4F 4D 31 
done
--

Original comment by mungew...@gmail.com on 27 Apr 2011 at 11:15

GoogleCodeExporter commented 8 years ago
thanks for the BTstack output. Obviously, something is different. But what's 
the difference between both encodings of an UINT8. Can you provide both SDP 
records as hex dump for comparison?

Original comment by matthias.ringwald@gmail.com on 28 Apr 2011 at 7:36

GoogleCodeExporter commented 8 years ago
OK, I put this one down to operator error. Looks like different flags in 
'sdptool' report the data in different ways.

Please close this bug as invalid.
Simon.

Original comment by mungew...@gmail.com on 10 May 2011 at 3:53

GoogleCodeExporter commented 8 years ago
OK, I put this one down to operator error. Looks like different flags in 
'sdptool' report the data in different ways.

Please close this bug as invalid.
Simon.

Original comment by mungew...@gmail.com on 10 May 2011 at 3:53

GoogleCodeExporter commented 8 years ago
I put this down to 'operator error', it looks like sdptool reports differently 
when different flags (ie. '--raw') are used.

Please close out this bug as invalid.
Simon

Original comment by mungew...@gmail.com on 10 May 2011 at 6:50

GoogleCodeExporter commented 8 years ago
Thanks for sorting that out

Original comment by matthias.ringwald@gmail.com on 11 May 2011 at 11:21