Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e4d2602 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

LE Audio: improve Appearance to CoD mapping

LE Audio devices with appearance of Wearable Device should have "LE Audio" bit in CoD set. Also set other related bits.

Currently, if such device is advertising over LE and Classic at same time, LE Audio bit would flicker.

Bug: 247504761
Test: manual
(cherry picked from commit 44bb4117)
Merged-In: Ifca26314320ddef360adf5642e2ae1b0c4e84781
Change-Id: Ifca26314320ddef360adf5642e2ae1b0c4e84781
parent d96ec0e7
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2267,8 +2267,13 @@ static void btm_ble_appearance_to_cod(uint16_t appearance, uint8_t* dev_class) {
      dev_class[1] = BTM_COD_MAJOR_AUDIO;
      dev_class[2] = BTM_COD_MINOR_UNCLASSIFIED;
      break;
    case BTM_BLE_APPEARANCE_GENERIC_WEARABLE_AUDIO_DEVICE:
    case BTM_BLE_APPEARANCE_WEARABLE_AUDIO_DEVICE_EARBUD:
      dev_class[1] = BTM_COD_MAJOR_AUDIO;
    case BTM_BLE_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADSET:
    case BTM_BLE_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADPHONES:
    case BTM_BLE_APPEARANCE_WEARABLE_AUDIO_DEVICE_NECK_BAND:
      dev_class[0] = (BTM_COD_SERVICE_AUDIO | BTM_COD_SERVICE_RENDERING) >> 8;
      dev_class[1] = (BTM_COD_MAJOR_AUDIO | BTM_COD_SERVICE_LE_AUDIO);
      dev_class[2] = BTM_COD_MINOR_WEARABLE_HEADSET;
      break;
    case BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER:
+4 −0
Original line number Diff line number Diff line
@@ -257,7 +257,11 @@ typedef uint8_t BLE_SIGNATURE[BTM_BLE_AUTH_SIGN_LEN]; /* Device address */
#define BTM_BLE_APPEARANCE_CYCLING_CADENCE 0x0483
#define BTM_BLE_APPEARANCE_CYCLING_POWER 0x0484
#define BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485
#define BTM_BLE_APPEARANCE_GENERIC_WEARABLE_AUDIO_DEVICE 0x0940
#define BTM_BLE_APPEARANCE_WEARABLE_AUDIO_DEVICE_EARBUD 0x0941
#define BTM_BLE_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADSET 0x0942
#define BTM_BLE_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADPHONES 0x0943
#define BTM_BLE_APPEARANCE_WEARABLE_AUDIO_DEVICE_NECK_BAND 0x0944
#define BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40
#define BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41
#define BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42