All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] device: Some devices send HSP UUIDs in the wrong order
@ 2015-07-13 21:32 Iñaki Arenaza
  2015-07-13 21:32 ` [PATCH 1/1] " Iñaki Arenaza
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Iñaki Arenaza @ 2015-07-13 21:32 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Iñaki Arenaza

[Please, CC me as I am not subscribed to the list.]

Hi all, 

Some devices behave contrary to what Erratum #3507 [1] says for the
v1.2 Headset Profile (HSP). They report HEADSET_HS_UUID as the first
value of the ServiceClassIDList attribute, and HSP_HS_UUID as the
second one. At leat one of those devices is the Energy Wireles BT 3
Ruby Red (from Energy Sistem).

[1] See section 6.15 of
    https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=231555

To make sure the issue is due to the headset and not to the Bluetooth
controller firmware, I have tested it with two differente computers
having two different controllers.

Below are the full details of the headset model, the two computer
models, the Bluetooth controller models, the raw output from sdptool
before applying the proposed patch (it's exactly the same in both
computers, so I'm attaching the details just once), and the output
from bluetoothctl when pairing the headset before and after applying
the patch (again the same on both computers, so attaching it once).

If I don't apply the patch, the headset is not recognized as an HSP
device and is not usable from Pulseaudio (I can just use the A2DP mode
of it). With the patch applied, it is correctly detected and can be
used either in A2DP or HSP mode in Pulseaudio.

Full Details
============
 
1.- Bluetooth headset model:

  Energy Wireles BT 3 Ruby Red (from Energy Sistem)

2.- First computer model:

  Hewlett-Packard HP ZBook 14/198F, BIOS L71 Ver. 01.30 12/09/2014

3.- Bluetooth adapter info for first computer model:

  root@osgiliath# lsusb -v -d "8087:07dc"
  Bus 001 Device 006: ID 8087:07dc Intel Corp. 
  Device Descriptor:
    bLength                18
    bDescriptorType         1
    bcdUSB               2.00
    bDeviceClass          224 Wireless
    bDeviceSubClass         1 Radio Frequency
    bDeviceProtocol         1 Bluetooth
    bMaxPacketSize0        64
    idVendor           0x8087 Intel Corp.
    idProduct          0x07dc 
    bcdDevice            0.01
    iManufacturer           0 
    iProduct                0 
    iSerial                 0 
    bNumConfigurations      1
    Configuration Descriptor:
      bLength                 9
      bDescriptorType         2
      wTotalLength          177
      bNumInterfaces          2
      bConfigurationValue     1
      iConfiguration          0 
      bmAttributes         0xe0
        Self Powered
        Remote Wakeup
      MaxPower              100mA
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        0
        bAlternateSetting       0
        bNumEndpoints           3
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x81  EP 1 IN
          bmAttributes            3
            Transfer Type            Interrupt
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x02  EP 2 OUT
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x82  EP 2 IN
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       0
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0000  1x 0 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0000  1x 0 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       1
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0009  1x 9 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0009  1x 9 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       2
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0011  1x 17 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0011  1x 17 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       3
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0019  1x 25 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0019  1x 25 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       4
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0021  1x 33 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0021  1x 33 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       5
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0031  1x 49 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0031  1x 49 bytes
          bInterval               1
  Device Status:     0x0001
    Self Powered

4. Second computer model:

  Hewlett-Packard HP Elitebook 6930p/30DB, BIOS 68CPU Ver. F.20 12/02/2011

5.- Bluetooth adapter info for second computer model:

  root@debian# lsusb -v -d "03f0:171d"
  Bus 001 Device 003: ID 03f0:171d Hewlett-Packard Bluetooth 2.0 Interface [Broadcom BCM2045]
  Device Descriptor:
    bLength                18
    bDescriptorType         1
    bcdUSB               2.00
    bDeviceClass          224 Wireless
    bDeviceSubClass         1 Radio Frequency
    bDeviceProtocol         1 Bluetooth
    bMaxPacketSize0        64
    idVendor           0x03f0 Hewlett-Packard
    idProduct          0x171d Bluetooth 2.0 Interface [Broadcom BCM2045]
    bcdDevice            1.00
    iManufacturer           1 Broadcom Corp
    iProduct                2 HP Integrated Module
    iSerial                 0 
    bNumConfigurations      1
    Configuration Descriptor:
      bLength                 9
      bDescriptorType         2
      wTotalLength          216
      bNumInterfaces          4
      bConfigurationValue     1
      iConfiguration          0 
      bmAttributes         0xe0
        Self Powered
        Remote Wakeup
      MaxPower                0mA
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        0
        bAlternateSetting       0
        bNumEndpoints           3
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x81  EP 1 IN
          bmAttributes            3
            Transfer Type            Interrupt
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0010  1x 16 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x82  EP 2 IN
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x02  EP 2 OUT
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       0
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0000  1x 0 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0000  1x 0 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       1
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0009  1x 9 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0009  1x 9 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       2
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0011  1x 17 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0011  1x 17 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       3
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0020  1x 32 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0020  1x 32 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       4
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       5
        bNumEndpoints           2
        bInterfaceClass       224 Wireless
        bInterfaceSubClass      1 Radio Frequency
        bInterfaceProtocol      1 Bluetooth
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            1
            Transfer Type            Isochronous
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        2
        bAlternateSetting       0
        bNumEndpoints           2
        bInterfaceClass       255 Vendor Specific Class
        bInterfaceSubClass    255 Vendor Specific Subclass
        bInterfaceProtocol    255 Vendor Specific Protocol
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x84  EP 4 IN
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0020  1x 32 bytes
          bInterval               1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x04  EP 4 OUT
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0020  1x 32 bytes
          bInterval               1
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        3
        bAlternateSetting       0
        bNumEndpoints           0
        bInterfaceClass       254 Application Specific Interface
        bInterfaceSubClass      1 Device Firmware Update
        bInterfaceProtocol      0 
        iInterface              0 
        Device Firmware Upgrade Interface Descriptor:
          bLength                             7
          bDescriptorType                    33
          bmAttributes                        7
            Will Not Detach
            Manifestation Tolerant
            Upload Supported
            Download Supported
          wDetachTimeout                   5000 milliseconds
          wTransferSize                      64 bytes
  Device Status:     0x0001
    Self Powered

6.- SDP info from the headset, before applying the patch:

  root@osgiliath# hciconfig hci0 up
  root@osgiliath# sdptool browse --raw DC:2C:26:10:1F:D8
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010000
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x1200 - PnPInformation
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0200
                  UINT16 0x0103
          Attribute 0x0201
                  UINT16 0x000f
          Attribute 0x0202
                  UINT16 0x0000
          Attribute 0x0203
                  UINT16 0x0000
          Attribute 0x0204
                  Bool True
          Attribute 0x0205
                  UINT16 0x0001
          Attribute 0x8001
                  UINT16 0x0001
  Service Search failed: Invalid argument
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010001
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x1131 - Headset (HSP)
                          UUID16 0x1108 - Headset
                          UUID16 0x1203 - GenericAudio
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                          Sequence
                                  UUID16 0x0003 - RFCOMM
                                  UINT8 0x01
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x1108 - Headset
                                  UINT16 0x0102
          Attribute 0x0100
                  Data 48 53 50 20 73 65 72 76 69 63 65 00 00
          Attribute 0x0302
                  Bool True
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010002
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x111e - Handsfree
                          UUID16 0x1203 - GenericAudio
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                          Sequence
                                  UUID16 0x0003 - RFCOMM
                                  UINT8 0x02
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x111e - Handsfree
                                  UINT16 0x0106
          Attribute 0x0100
                  Data 48 46 50 20 73 65 72 76 69 63 65 00 00
          Attribute 0x0311
                  UINT16 0x00bf
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010003
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x110c - RemoteControlTarget
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                                  UINT16 0x0017
                          Sequence
                                  UUID16 0x0017 - AVCTP
                                  UINT16 0x0103
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x110e - RemoteControl
                                  UINT16 0x0104
          Attribute 0x000d - AdditionalProtocolDescriptorLists
                  Sequence
                          Sequence
                                  Sequence
                                          UUID16 0x0100 - L2CAP
                                          UINT16 0x001b
                                  Sequence
                                          UUID16 0x0017 - AVCTP
                                          UINT16 0x0103
          Attribute 0x0311
                  UINT16 0x0002
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010004
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x110e - RemoteControl
                          UUID16 0x110f - RemoteControlController
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                                  UINT16 0x0017
                          Sequence
                                  UUID16 0x0017 - AVCTP
                                  UINT16 0x0103
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x110e - RemoteControl
                                  UINT16 0x0104
          Attribute 0x000d - AdditionalProtocolDescriptorLists
                  Sequence
                          Sequence
                                  Sequence
                                          UUID16 0x0100 - L2CAP
                                          UINT16 0x001b
                                  Sequence
                                          UUID16 0x0017 - AVCTP
                                          UINT16 0x0103
          Attribute 0x0311
                  UINT16 0x0003
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010005
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x110b - AudioSink
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                                  UINT16 0x0019
                          Sequence
                                  UUID16 0x0019 - AVDTP
                                  UINT16 0x0103
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x110d - AdvancedAudio
                                  UINT16 0x0103
          Attribute 0x0100
                  Data 41 64 76 61 6e 63 65 64 20 61 75 64 69 6f 20 73 65 72 76 69 63 65 00 00
          Attribute 0x0311
                  UINT16 0x0001
  
7.- Bluetooth discovery, pairing and configuration, before applying
    the patch:

  root@osgiliath# /usr/sbin/bluetoothd &
  root@osgiliath# bluetoothctl
  [NEW] Controller AC:FD:CE:02:8D:AB osgiliath [default]
  [bluetooth]# power on
  Changing power on succeeded
  [CHG] Controller AC:FD:CE:02:8D:AB Powered: yes
  [bluetooth]# scan on
  Discovery started
  [CHG] Controller AC:FD:CE:02:8D:AB Discovering: yes
  [NEW] Device DC:2C:26:10:1F:D8 Energy BT 3
  [CHG] Device DC:2C:26:10:1F:D8 RSSI: -49
  [bluetooth]# pair DC:2C:26:10:1F:D8 
  Attempting to pair with DC:2C:26:10:1F:D8
  [CHG] Device DC:2C:26:10:1F:D8 Connected: yes
  [CHG] Device DC:2C:26:10:1F:D8 Modalias: bluetooth:v000Fp0000d0000
  [CHG] Device DC:2C:26:10:1F:D8 UUIDs:
          0000110b-0000-1000-8000-00805f9b34fb
          0000110c-0000-1000-8000-00805f9b34fb
          0000110e-0000-1000-8000-00805f9b34fb
          0000111e-0000-1000-8000-00805f9b34fb
          00001131-0000-1000-8000-00805f9b34fb
          00001200-0000-1000-8000-00805f9b34fb
  [CHG] Device DC:2C:26:10:1F:D8 Paired: yes
  Pairing successful
  [bluetooth]# scan off
  [CHG] Device DC:2C:26:10:1F:D8 RSSI is nil
  [CHG] Controller AC:FD:CE:02:8D:AB Discovering: no
  Discovery stopped
  [CHG] Device DC:2C:26:10:1F:D8 Connected: no
  [bluetooth]# info DC:2C:26:10:1F:D8 
  Device DC:2C:26:10:1F:D8
          Name: Energy BT 3
          Alias: Energy BT 3
          Class: 0x240404
          Icon: audio-card
          Paired: yes
          Trusted: no
          Blocked: no
          Connected: no
          LegacyPairing: no
          UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
          UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
          UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
          UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
          UUID: Headset HS                (00001131-0000-1000-8000-00805f9b34fb)
          UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
          Modalias: bluetooth:v000Fp0000d0000
  [bluetooth]# exit

8. SDP info from the headset (after applying the patch). Nothing
   changes, as expected:

  root@osgiliath# sdptool browse --raw DC:2C:26:10:1F:D8
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010000
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x1200 - PnPInformation
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0200
                  UINT16 0x0103
          Attribute 0x0201
                  UINT16 0x000f
          Attribute 0x0202
                  UINT16 0x0000
          Attribute 0x0203
                  UINT16 0x0000
          Attribute 0x0204
                  Bool True
          Attribute 0x0205
                  UINT16 0x0001
          Attribute 0x8001
                  UINT16 0x0001
  Service Search failed: Invalid argument
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010001
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x1131 - Headset (HSP)
                          UUID16 0x1108 - Headset
                          UUID16 0x1203 - GenericAudio
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                          Sequence
                                  UUID16 0x0003 - RFCOMM
                                  UINT8 0x01
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x1108 - Headset
                                  UINT16 0x0102
          Attribute 0x0100
                  Data 48 53 50 20 73 65 72 76 69 63 65 00 00
          Attribute 0x0302
                  Bool True
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010002
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x111e - Handsfree
                          UUID16 0x1203 - GenericAudio
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                          Sequence
                                  UUID16 0x0003 - RFCOMM
                                  UINT8 0x02
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x111e - Handsfree
                                  UINT16 0x0106
          Attribute 0x0100
                  Data 48 46 50 20 73 65 72 76 69 63 65 00 00
          Attribute 0x0311
                  UINT16 0x00bf
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010003
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x110c - RemoteControlTarget
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                                  UINT16 0x0017
                          Sequence
                                  UUID16 0x0017 - AVCTP
                                  UINT16 0x0103
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x110e - RemoteControl
                                  UINT16 0x0104
          Attribute 0x000d - AdditionalProtocolDescriptorLists
                  Sequence
                          Sequence
                                  Sequence
                                          UUID16 0x0100 - L2CAP
                                          UINT16 0x001b
                                  Sequence
                                          UUID16 0x0017 - AVCTP
                                          UINT16 0x0103
          Attribute 0x0311
                  UINT16 0x0002
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010004
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x110e - RemoteControl
                          UUID16 0x110f - RemoteControlController
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                                  UINT16 0x0017
                          Sequence
                                  UUID16 0x0017 - AVCTP
                                  UINT16 0x0103
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x110e - RemoteControl
                                  UINT16 0x0104
          Attribute 0x000d - AdditionalProtocolDescriptorLists
                  Sequence
                          Sequence
                                  Sequence
                                          UUID16 0x0100 - L2CAP
                                          UINT16 0x001b
                                  Sequence
                                          UUID16 0x0017 - AVCTP
                                          UINT16 0x0103
          Attribute 0x0311
                  UINT16 0x0003
  Sequence
          Attribute 0x0000 - ServiceRecordHandle
                  UINT32 0x00010005
          Attribute 0x0001 - ServiceClassIDList
                  Sequence
                          UUID16 0x110b - AudioSink
          Attribute 0x0004 - ProtocolDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x0100 - L2CAP
                                  UINT16 0x0019
                          Sequence
                                  UUID16 0x0019 - AVDTP
                                  UINT16 0x0103
          Attribute 0x0005 - BrowseGroupList
                  Sequence
                          UUID16 0x1002 - PublicBrowseGroup
          Attribute 0x0009 - BluetoothProfileDescriptorList
                  Sequence
                          Sequence
                                  UUID16 0x110d - AdvancedAudio
                                  UINT16 0x0103
          Attribute 0x0100
                  Data 41 64 76 61 6e 63 65 64 20 61 75 64 69 6f 20 73 65 72 76 69 63 65 00 00
          Attribute 0x0311
                  UINT16 0x0001

9.- Bluetooth discovery, pairing and configuration, after applying
    the patch. As we can see, the HSP UUID is now recognized, and the
    additional HSP HS UUID has disappeared.
    
  root@osgiliath:/var/lib/bluetooth# bluetoothctl 
  [NEW] Controller AC:FD:CE:02:8D:AB osgiliath [default]
  [bluetooth]# power on
  Changing power on succeeded
  [CHG] Controller AC:FD:CE:02:8D:AB Powered: yes
  [bluetooth]# scan on
  Discovery started
  [NEW] Device DC:2C:26:10:1F:D8 Energy BT 3
  [bluetooth]# pair DC:2C:26:10:1F:D8 
  Attempting to pair with DC:2C:26:10:1F:D8
  [CHG] Device DC:2C:26:10:1F:D8 Connected: yes
  [CHG] Device DC:2C:26:10:1F:D8 Modalias: bluetooth:v000Fp0000d0000
  [CHG] Device DC:2C:26:10:1F:D8 UUIDs:
          00001108-0000-1000-8000-00805f9b34fb
          0000110b-0000-1000-8000-00805f9b34fb
          0000110c-0000-1000-8000-00805f9b34fb
          0000110e-0000-1000-8000-00805f9b34fb
          0000111e-0000-1000-8000-00805f9b34fb
          00001200-0000-1000-8000-00805f9b34fb
  [CHG] Device DC:2C:26:10:1F:D8 Paired: yes
  Pairing successful
  [bluetooth]# scan off
  [CHG] Device DC:2C:26:10:1F:D8 RSSI is nil
  [CHG] Controller AC:FD:CE:02:8D:AB Discovering: no
  Discovery stopped
  [CHG] Device DC:2C:26:10:1F:D8 Connected: no
  [bluetooth]# info DC:2C:26:10:1F:D8 
  Device DC:2C:26:10:1F:D8
          Name: Energy BT 3
          Alias: Energy BT 3
          Class: 0x240404
          Icon: audio-card
          Paired: yes
          Trusted: no
          Blocked: no
          Connected: no
          LegacyPairing: no
          UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
          UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
          UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
          UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
          UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
          UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
          Modalias: bluetooth:v000Fp0000d0000
  [bluetooth]# exit
  
Iñaki Arenaza (1):
  device: Some devices send HSP UUIDs in the wrong order

 lib/uuid.h   |  1 +
 src/device.c | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] device: Some devices send HSP UUIDs in the wrong order
  2015-07-13 21:32 [PATCH 0/1] device: Some devices send HSP UUIDs in the wrong order Iñaki Arenaza
@ 2015-07-13 21:32 ` Iñaki Arenaza
  2015-07-14 12:17   ` Luiz Augusto von Dentz
  2015-07-19 14:55 ` [PATCH v2 0/1] " Iñaki Arenaza
  2015-07-19 14:57 ` [PATCH v2 1/1] " Iñaki Arenaza
  2 siblings, 1 reply; 6+ messages in thread
From: Iñaki Arenaza @ 2015-07-13 21:32 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Iñaki Arenaza

Some devices behave contrary to what Erratum #3507 [1] says for the
v1.2 Headset Profile (HSP). They report HEADSET_HS_UUID as the first
value of the ServiceClassIDList attribute, and HSP_HS_UUID as the
second one. One of those devices is the Energy Wireles BT 3 Ruby Red
(from Energy Sistem)

[1] See section 6.15 of
https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=231555
---
 lib/uuid.h   |  1 +
 src/device.c | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/lib/uuid.h b/lib/uuid.h
index 2dcfe9e..c2e12bb 100644
--- a/lib/uuid.h
+++ b/lib/uuid.h
@@ -35,6 +35,7 @@ extern "C" {
 
 #define HSP_HS_UUID		"00001108-0000-1000-8000-00805f9b34fb"
 #define HSP_AG_UUID		"00001112-0000-1000-8000-00805f9b34fb"
+#define HEADSET_HS_UUID		"00001131-0000-1000-8000-00805f9b34fb"
 
 #define HFP_HS_UUID		"0000111e-0000-1000-8000-00805f9b34fb"
 #define HFP_AG_UUID		"0000111f-0000-1000-8000-00805f9b34fb"
diff --git a/src/device.c b/src/device.c
index debe201..4e03780 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3880,6 +3880,23 @@ static void update_bredr_services(struct browse_req *req, sdp_list_t *recs)
 			continue;
 		}
 
+		/* Fix devices that report HEADSET_HS_UUID before HSP_HS_UUID,
+		 * contrary to what Erratum #3507 says.
+		 */
+		if ((bt_uuid_strcmp(profile_uuid, HEADSET_HS_UUID) == 0)) {
+			if (svcclass->next != NULL) {
+				char *uuid;
+
+				uuid = bt_uuid2string(svcclass->next->data);
+				if (bt_uuid_strcmp(uuid, HSP_HS_UUID) == 0) {
+					free(profile_uuid);
+					profile_uuid = uuid;
+				} else {
+					free(uuid);
+				}
+			}
+		}
+
 		if (bt_uuid_strcmp(profile_uuid, PNP_UUID) == 0) {
 			uint16_t source, vendor, product, version;
 			sdp_data_t *pdlist;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] device: Some devices send HSP UUIDs in the wrong order
  2015-07-13 21:32 ` [PATCH 1/1] " Iñaki Arenaza
@ 2015-07-14 12:17   ` Luiz Augusto von Dentz
  2015-07-14 12:28     ` Iñaki Arenaza
  0 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2015-07-14 12:17 UTC (permalink / raw)
  To: Iñaki Arenaza; +Cc: linux-bluetooth@vger.kernel.org

Hi Iñaki,

On Tue, Jul 14, 2015 at 12:32 AM, Iñaki Arenaza <iarenaza@mondragon.edu> wrote:
> Some devices behave contrary to what Erratum #3507 [1] says for the
> v1.2 Headset Profile (HSP). They report HEADSET_HS_UUID as the first
> value of the ServiceClassIDList attribute, and HSP_HS_UUID as the
> second one. One of those devices is the Energy Wireles BT 3 Ruby Red
> (from Energy Sistem)
>
> [1] See section 6.15 of
> https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=231555
> ---
>  lib/uuid.h   |  1 +
>  src/device.c | 17 +++++++++++++++++
>  2 files changed, 18 insertions(+)
>
> diff --git a/lib/uuid.h b/lib/uuid.h
> index 2dcfe9e..c2e12bb 100644
> --- a/lib/uuid.h
> +++ b/lib/uuid.h
> @@ -35,6 +35,7 @@ extern "C" {
>
>  #define HSP_HS_UUID            "00001108-0000-1000-8000-00805f9b34fb"
>  #define HSP_AG_UUID            "00001112-0000-1000-8000-00805f9b34fb"
> +#define HEADSET_HS_UUID                "00001131-0000-1000-8000-00805f9b34fb"
>
>  #define HFP_HS_UUID            "0000111e-0000-1000-8000-00805f9b34fb"
>  #define HFP_AG_UUID            "0000111f-0000-1000-8000-00805f9b34fb"
> diff --git a/src/device.c b/src/device.c
> index debe201..4e03780 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -3880,6 +3880,23 @@ static void update_bredr_services(struct browse_req *req, sdp_list_t *recs)
>                         continue;
>                 }
>
> +               /* Fix devices that report HEADSET_HS_UUID before HSP_HS_UUID,
> +                * contrary to what Erratum #3507 says.
> +                */
> +               if ((bt_uuid_strcmp(profile_uuid, HEADSET_HS_UUID) == 0)) {

I guess we could stop right here and just assume it should be
HSP_HS_UUID instead so you just have to free and use assign
g_strdup(HSP_HS_UUID) to profile_uuid.

> +                       if (svcclass->next != NULL) {
> +                               char *uuid;
> +
> +                               uuid = bt_uuid2string(svcclass->next->data);
> +                               if (bt_uuid_strcmp(uuid, HSP_HS_UUID) == 0) {
> +                                       free(profile_uuid);
> +                                       profile_uuid = uuid;
> +                               } else {
> +                                       free(uuid);
> +                               }
> +                       }
> +               }
> +
>                 if (bt_uuid_strcmp(profile_uuid, PNP_UUID) == 0) {
>                         uint16_t source, vendor, product, version;
>                         sdp_data_t *pdlist;
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] device: Some devices send HSP UUIDs in the wrong order
  2015-07-14 12:17   ` Luiz Augusto von Dentz
@ 2015-07-14 12:28     ` Iñaki Arenaza
  0 siblings, 0 replies; 6+ messages in thread
From: Iñaki Arenaza @ 2015-07-14 12:28 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth@vger.kernel.org

On Tue, Jul 14 2015, Luiz Augusto von Dentz wrote:

Hi Luiz,

>> +               /* Fix devices that report HEADSET_HS_UUID before HSP_HS_UUID,
>> +                * contrary to what Erratum #3507 says.
>> +                */
>> +               if ((bt_uuid_strcmp(profile_uuid, HEADSET_HS_UUID) == 0)) {
>
> I guess we could stop right here and just assume it should be
> HSP_HS_UUID instead so you just have to free and use assign
> g_strdup(HSP_HS_UUID) to profile_uuid.

That was exactly what I did in my first (private) version of the
patch. But I wanted to play safe and make sure HSP_HS_UUID was also
there.

Frankly, I don't know how broken other devices are, as I don't deal with
Bluetooth on a regular basis. So I fully trust your judgement on this
:-)

Best regards,

-- 
Iñaki Arenaza

Electronics and Computing Department
Mondragon University – Faculty of Engineering
http://www.mondragon.edu/
Goiru kalea 2, 20500 Arrasate-Mondragon (Spain)
Tel: +34 647503750 (direct) / +34 943794700 (pbx)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 0/1] device: Some devices send HSP UUIDs in the wrong order
  2015-07-13 21:32 [PATCH 0/1] device: Some devices send HSP UUIDs in the wrong order Iñaki Arenaza
  2015-07-13 21:32 ` [PATCH 1/1] " Iñaki Arenaza
@ 2015-07-19 14:55 ` Iñaki Arenaza
  2015-07-19 14:57 ` [PATCH v2 1/1] " Iñaki Arenaza
  2 siblings, 0 replies; 6+ messages in thread
From: Iñaki Arenaza @ 2015-07-19 14:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Iñaki Arenaza

This is the updated version of the patch, taking Luiz Augusto's comments into
account. See <1436823169-32164-1-git-send-email-iarenaza@mondragon.edu> for the
original details.

Iñaki Arenaza (1):
  device: Some devices send HSP UUIDs in the wrong order

 lib/uuid.h   |  1 +
 src/device.c | 12 ++++++++++++
 2 files changed, 13 insertions(+)

-- 
2.1.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/1] device: Some devices send HSP UUIDs in the wrong order
  2015-07-13 21:32 [PATCH 0/1] device: Some devices send HSP UUIDs in the wrong order Iñaki Arenaza
  2015-07-13 21:32 ` [PATCH 1/1] " Iñaki Arenaza
  2015-07-19 14:55 ` [PATCH v2 0/1] " Iñaki Arenaza
@ 2015-07-19 14:57 ` Iñaki Arenaza
  2 siblings, 0 replies; 6+ messages in thread
From: Iñaki Arenaza @ 2015-07-19 14:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Iñaki Arenaza

Some devices behave contrary to what Erratum #3507 [1] says for the
v1.2 Headset Profile (HSP). They report HEADSET_HS_UUID as the first
value of the ServiceClassIDList attribute, and HSP_HS_UUID as the
second one. At leat one of those devices is the Energy Wireles BT 3
Ruby Red (from Energy Sistem).

[1] See section 6.15 of
https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=231555
---
 lib/uuid.h   |  1 +
 src/device.c | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/uuid.h b/lib/uuid.h
index 2dcfe9e..c2e12bb 100644
--- a/lib/uuid.h
+++ b/lib/uuid.h
@@ -35,6 +35,7 @@ extern "C" {
 
 #define HSP_HS_UUID		"00001108-0000-1000-8000-00805f9b34fb"
 #define HSP_AG_UUID		"00001112-0000-1000-8000-00805f9b34fb"
+#define HEADSET_HS_UUID		"00001131-0000-1000-8000-00805f9b34fb"
 
 #define HFP_HS_UUID		"0000111e-0000-1000-8000-00805f9b34fb"
 #define HFP_AG_UUID		"0000111f-0000-1000-8000-00805f9b34fb"
diff --git a/src/device.c b/src/device.c
index debe201..ced59e4 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3880,6 +3880,18 @@ static void update_bredr_services(struct browse_req *req, sdp_list_t *recs)
 			continue;
 		}
 
+		/* Fix devices that report HEADSET_HS_UUID before HSP_HS_UUID,
+		 * contrary to what Erratum #3507 says.
+		 */
+		if ((bt_uuid_strcmp(profile_uuid, HEADSET_HS_UUID) == 0)) {
+			free(profile_uuid);
+			profile_uuid = g_strdup(HSP_HS_UUID);
+			if (!profile_uuid) {
+				sdp_list_free(svcclass, free);
+				continue;
+			}
+		}
+
 		if (bt_uuid_strcmp(profile_uuid, PNP_UUID) == 0) {
 			uint16_t source, vendor, product, version;
 			sdp_data_t *pdlist;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-19 14:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-13 21:32 [PATCH 0/1] device: Some devices send HSP UUIDs in the wrong order Iñaki Arenaza
2015-07-13 21:32 ` [PATCH 1/1] " Iñaki Arenaza
2015-07-14 12:17   ` Luiz Augusto von Dentz
2015-07-14 12:28     ` Iñaki Arenaza
2015-07-19 14:55 ` [PATCH v2 0/1] " Iñaki Arenaza
2015-07-19 14:57 ` [PATCH v2 1/1] " Iñaki Arenaza

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.