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

Commit bd8ddef7 authored by Yun-hao Chung's avatar Yun-hao Chung Committed by Automerger Merge Worker
Browse files

Merge "Floss: Match cod based on major and minor class" am: dc2b9f32 am: 153553b6

parents 85a910ba 153553b6
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -116,6 +116,10 @@ const Uuid UUID_BATTERY = Uuid::FromString("180F");
const Uuid UUID_A2DP_SINK = Uuid::FromString("110B");

#define COD_UNCLASSIFIED ((0x1F) << 8)

/* Focus on Major and minor device class*/
#define COD_DEVICE_MASK 0x1FFC

#define COD_HID_KEYBOARD 0x0540
#define COD_HID_POINTING 0x0580
#define COD_HID_COMBO 0x05C0
@@ -510,7 +514,7 @@ static uint32_t get_cod(const RawAddress* remote_bdaddr) {
}

bool check_cod(const RawAddress* remote_bdaddr, uint32_t cod) {
  return get_cod(remote_bdaddr) == cod;
  return (get_cod(remote_bdaddr) & COD_DEVICE_MASK) == cod;
}

bool check_cod_hid(const RawAddress* remote_bdaddr) {