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

Commit b162e61a authored by Jacky Cheung's avatar Jacky Cheung
Browse files

DO NOT MERGE ANYWHERE LE Connection Parameter Update Callback

The callback ends at the btif layer and does not go up to the HAL layer.
Event logging is added to track success rate.

BUG: 28800115

Change-Id: I73ad281437760e1d61dd4e504401b270eb77e3e6
parent 360ce44e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -36,3 +36,4 @@
1010000 bt_hci_timeout (opcode|1)
1010001 bt_config_source (opcode|1)
1010002 bt_hci_unknown_type (hci_type|1)
1010003 bt_conn_param_update_status (status|1)
+5 −4
Original line number Diff line number Diff line
@@ -4654,7 +4654,8 @@ void bta_dm_ble_update_conn_params (tBTA_DM_MSG *p_data)
                                  p_data->ble_update_conn_params.min_int,
                                  p_data->ble_update_conn_params.max_int,
                                  p_data->ble_update_conn_params.latency,
                                 p_data->ble_update_conn_params.timeout))
                                  p_data->ble_update_conn_params.timeout,
                                  p_data->ble_update_conn_params.p_conn_param_update_cback))
    {
        APPL_TRACE_ERROR("Update connection parameters failed!");
    }
+6 −36
Original line number Diff line number Diff line
@@ -1311,39 +1311,6 @@ void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services, t
    UNUSED(p_cback);
#endif
}
/*******************************************************************************
**
** Function         BTA_DmBleUpdateConnectionParam
**
** Description      Update connection parameters, can only be used when connection is up.
**
** Parameters:      bd_addr          - BD address of the peer
**                  min_int   -     minimum connection interval, [0x0004~ 0x4000]
**                  max_int   -     maximum connection interval, [0x0004~ 0x4000]
**                  latency   -     slave latency [0 ~ 500]
**                  timeout   -     supervision timeout [0x000a ~ 0xc80]
**
** Returns          void
**
*******************************************************************************/
void BTA_DmBleUpdateConnectionParam(BD_ADDR bd_addr, UINT16 min_int,
                                    UINT16 max_int, UINT16 latency,
                                    UINT16 timeout)
{
#if BLE_INCLUDED == TRUE
    tBTA_DM_API_UPDATE_CONN_PARAM *p_msg =
        (tBTA_DM_API_UPDATE_CONN_PARAM *)osi_calloc(sizeof(tBTA_DM_API_UPDATE_CONN_PARAM));

    p_msg->hdr.event = BTA_DM_API_UPDATE_CONN_PARAM_EVT;
    bdcpy(p_msg->bd_addr, bd_addr);
    p_msg->min_int = min_int;
    p_msg->max_int = max_int;
    p_msg->latency = latency;
    p_msg->timeout = timeout;

    bta_sys_sendmsg(p_msg);
#endif
}

/*******************************************************************************
**
@@ -1751,12 +1718,14 @@ void BTA_DmEnableScanFilter(UINT8 action, tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cb
**                  max_int   -     maximum connection interval, [0x0004~ 0x4000]
**                  latency   -     slave latency [0 ~ 500]
**                  timeout   -     supervision timeout [0x000a ~ 0xc80]
                    p_cback   -     callback on connection parameters updated
**
** Returns          void
**
*******************************************************************************/
void BTA_DmBleUpdateConnectionParams(BD_ADDR bd_addr, UINT16 min_int, UINT16 max_int,
                                    UINT16 latency, UINT16 timeout)
void BTA_DmBleUpdateConnectionParams(BD_ADDR bd_addr, UINT16 min_int,
                                     UINT16 max_int, UINT16 latency, UINT16 timeout,
                                     tBTA_DM_BLE_CONN_PARAM_CBACK *p_cback)
{
    tBTA_DM_API_UPDATE_CONN_PARAM *p_msg =
        (tBTA_DM_API_UPDATE_CONN_PARAM *)osi_calloc(sizeof(tBTA_DM_API_UPDATE_CONN_PARAM));
@@ -1767,6 +1736,7 @@ void BTA_DmBleUpdateConnectionParams(BD_ADDR bd_addr, UINT16 min_int, UINT16 max
    p_msg->max_int = max_int;
    p_msg->latency = latency;
    p_msg->timeout = timeout;
    p_msg->p_conn_param_update_cback = p_cback;

    bta_sys_sendmsg(p_msg);
}
+4 −2
Original line number Diff line number Diff line
@@ -436,7 +436,6 @@ typedef struct
    UINT16                  conn_int_max;
    UINT16                  supervision_tout;
    UINT16                  slave_latency;

}tBTA_DM_API_BLE_CONN_PARAMS;

typedef struct
@@ -611,6 +610,8 @@ typedef struct
    tBTA_DM_LINK_TYPE link_type;

} tBTA_DM_API_REMOVE_ALL_ACL;

/* data type for BTA_DM_API_UPDATE_CONN_PARAM_EVT */
typedef struct
{
    BT_HDR      hdr;
@@ -619,6 +620,7 @@ typedef struct
    UINT16      max_int;
    UINT16      latency;
    UINT16      timeout;
    tBTA_DM_BLE_CONN_PARAM_CBACK *p_conn_param_update_cback;
} tBTA_DM_API_UPDATE_CONN_PARAM;

#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+2 −2
Original line number Diff line number Diff line
@@ -1805,7 +1805,7 @@ void bta_hh_w4_le_read_char_cmpl(tBTA_HH_DEV_CB *p_dev_cb, tBTA_HH_DATA *p_buf)
            tout = BTM_BLE_CONN_TIMEOUT_MIN_DEF;

        BTM_BleSetPrefConnParams(p_dev_cb->addr, min, max, latency, tout);
        L2CA_UpdateBleConnParams(p_dev_cb->addr, min, max, latency, tout);
        L2CA_UpdateBleConnParams(p_dev_cb->addr, min, max, latency, tout, NULL);
    }
    else
    {
Loading