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

Commit fe702c2f authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

HID multi-device refactoring

We don't really support multiple HID services in same device.
We shouldn't use default value 0 for service id.
We shouldn't merge service id and characteristic id into one field,
as it's done not right right now.

Bug: 27455533
Change-Id: I46cc1b62bb2c7393e62f3b1a8e4650706954a066
parent a08618ee
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -191,8 +191,8 @@ typedef struct
{
    UINT8                   index;
    BOOLEAN                 in_use;
    UINT8                   inst_id;    /* share service instance ID and report instance ID, as
                                           hi 4 for service instance ID, low 4 as charatceristic instance ID */
    UINT8                   srvc_inst_id;
    UINT8                   char_inst_id;
    tBTA_HH_RPT_TYPE        rpt_type;
    UINT16                  uuid;
    UINT8                   prop;
@@ -208,6 +208,7 @@ typedef struct
typedef struct
{
    BOOLEAN                 in_use;
    UINT8                   srvc_inst_id;
    tBTA_HH_LE_RPT          report[BTA_HH_LE_RPT_MAX];

#define BTA_HH_LE_PROTO_MODE_BIT        0x01
@@ -223,10 +224,6 @@ typedef struct

}tBTA_HH_LE_HID_SRVC;

#ifndef BTA_HH_LE_HID_SRVC_MAX
#define BTA_HH_LE_HID_SRVC_MAX      1
#endif

/* convert a HID handle to the LE CB index */
#define BTA_HH_GET_LE_CB_IDX(x)         (((x) >> 4) - 1)
/* convert a GATT connection ID to HID device handle, it is the hi 4 bits of a UINT8 */
@@ -267,12 +264,10 @@ typedef struct
    tBTA_HH_STATUS      status;
    tBTA_GATT_REASON    reason;
    BOOLEAN             is_le_device;
    tBTA_HH_LE_HID_SRVC hid_srvc[BTA_HH_LE_HID_SRVC_MAX];
    tBTA_HH_LE_HID_SRVC hid_srvc;
    UINT16              conn_id;
    BOOLEAN             in_bg_conn;
    UINT8               total_srvc;
    UINT8               clt_cfg_idx;
    UINT8               cur_srvc_index; /* currently discovering service index */
    BOOLEAN             scps_supported;

#define BTA_HH_LE_SCPS_NOTIFY_NONE    0
+132 −202

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -31,7 +31,8 @@ typedef struct
    UINT16              rpt_uuid;
    UINT8               rpt_id;
    tBTA_HH_RPT_TYPE    rpt_type;
    UINT8               inst_id;
    UINT8               srvc_inst_id;
    UINT8               char_inst_id;
    UINT8               prop;
}tBTA_HH_RPT_CACHE_ENTRY;