* Returns void
*
******************************************************************************/
-void bta_hh_start_sdp(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_start_sdp(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
tBTA_HH_STATUS status = BTA_HH_ERR_SDP;
uint8_t hdl;
* Returns void
*
******************************************************************************/
-void bta_hh_sdp_cmpl(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_sdp_cmpl(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
CHECK(p_data != nullptr);
tBTA_HH_CONN conn_dat;
* Returns void
*
******************************************************************************/
-void bta_hh_api_disc_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+extern void btif_hh_remove_device(RawAddress bd_addr);
+void bta_hh_api_disc_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
CHECK(p_cb != nullptr);
if (p_cb->is_le_device) {
* Returns void
*
******************************************************************************/
-void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
tBTA_HH_CONN conn;
uint8_t dev_handle =
p_data ? (uint8_t)p_data->hid_cback.hdr.layer_specific : p_cb->hid_handle;
* Returns void
*
******************************************************************************/
-void bta_hh_open_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_open_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
tBTA_HH_API_CONN conn_data;
uint8_t dev_handle =
* Returns void
*
******************************************************************************/
-void bta_hh_data_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_data_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
BT_HDR* pdata = p_data->hid_cback.p_data;
uint8_t* p_rpt = (uint8_t*)(pdata + 1) + pdata->offset;
* Returns void
*
******************************************************************************/
-void bta_hh_handsk_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_handsk_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
APPL_TRACE_DEBUG("HANDSHAKE received for: event = %s data= %d",
bta_hh_get_w4_event(p_cb->w4_evt), p_data->hid_cback.data);
* Returns void
*
******************************************************************************/
-void bta_hh_ctrl_dat_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_ctrl_dat_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
BT_HDR* pdata = p_data->hid_cback.p_data;
uint8_t* data = (uint8_t*)(pdata + 1) + pdata->offset;
tBTA_HH_HSDATA hs_data;
* Returns void
*
******************************************************************************/
-void bta_hh_open_failure(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_open_failure(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
tBTA_HH_CONN conn_dat;
uint32_t reason = p_data->hid_cback.data; /* Reason for closing (32-bit) */
* Returns void
*
******************************************************************************/
-void bta_hh_close_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_close_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
tBTA_HH_CONN conn_dat;
tBTA_HH_CBDATA disc_dat = {BTA_HH_OK, 0};
*
******************************************************************************/
void bta_hh_get_dscp_act(tBTA_HH_DEV_CB* p_cb,
- UNUSED_ATTR tBTA_HH_DATA* p_data) {
+ UNUSED_ATTR const tBTA_HH_DATA* p_data) {
if (p_cb->is_le_device) {
bta_hh_le_get_dscp_act(p_cb);
} else
* Returns void
*
******************************************************************************/
-void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
- tBTA_HH_MAINT_DEV* p_dev_info = &p_data->api_maintdev;
+void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
+ const tBTA_HH_MAINT_DEV* p_dev_info = &p_data->api_maintdev;
tBTA_HH_DEV_INFO dev_info;
uint8_t dev_handle;
return api_sndcmd_param;
}
-void bta_hh_write_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_write_dev_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
tBTA_HH_CBDATA cbdata = {BTA_HH_OK, 0};
uint16_t event = (p_data->api_sndcmd.t_type - BTA_HH_FST_BTE_TRANS_EVT) +
BTA_HH_FST_TRANS_CB_EVT;
****************************************************************************/
extern bool bta_hh_hdl_event(BT_HDR_RIGID* p_msg);
extern void bta_hh_sm_execute(tBTA_HH_DEV_CB* p_cb, uint16_t event,
- tBTA_HH_DATA* p_data);
+ const tBTA_HH_DATA* p_data);
/* action functions */
-extern void bta_hh_api_disc_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_open_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_close_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_data_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_ctrl_dat_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_start_sdp(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_sdp_cmpl(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_write_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_get_dscp_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_handsk_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_open_failure(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
+extern void bta_hh_api_disc_act(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_data);
+extern void bta_hh_open_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data);
+extern void bta_hh_close_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data);
+extern void bta_hh_data_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data);
+extern void bta_hh_ctrl_dat_act(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_data);
+extern void bta_hh_start_sdp(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data);
+extern void bta_hh_sdp_cmpl(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data);
+extern void bta_hh_write_dev_act(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_data);
+extern void bta_hh_get_dscp_act(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_data);
+extern void bta_hh_handsk_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data);
+extern void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_data);
+extern void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_data);
+extern void bta_hh_open_failure(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_data);
/* utility functions */
extern uint8_t bta_hh_find_cb(const RawAddress& bda);
extern void bta_hh_add_device_to_list(tBTA_HH_DEV_CB* p_cb, uint8_t handle,
uint16_t attr_mask,
- tHID_DEV_DSCP_INFO* p_dscp_info,
+ const tHID_DEV_DSCP_INFO* p_dscp_info,
uint8_t sub_class, uint16_t max_latency,
uint16_t min_tout, uint8_t app_id);
extern void bta_hh_update_di_info(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id,
const RawAddress& remote_bda);
extern void bta_hh_le_api_disc_act(tBTA_HH_DEV_CB* p_cb);
extern void bta_hh_le_get_dscp_act(tBTA_HH_DEV_CB* p_cb);
-extern void bta_hh_le_write_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
+extern void bta_hh_le_write_dev_act(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_data);
extern uint8_t bta_hh_le_add_device(tBTA_HH_DEV_CB* p_cb,
- tBTA_HH_MAINT_DEV* p_dev_info);
+ const tBTA_HH_MAINT_DEV* p_dev_info);
extern void bta_hh_le_remove_dev_bg_conn(tBTA_HH_DEV_CB* p_cb);
-extern void bta_hh_le_open_fail(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_gatt_open(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_gatt_close(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data);
-extern void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_buf);
-
-extern void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_buf);
-extern void bta_hh_security_cmpl(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_buf);
+extern void bta_hh_le_open_fail(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_data);
+extern void bta_hh_gatt_open(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data);
+extern void bta_hh_gatt_close(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data);
+extern void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_buf);
+
+extern void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_buf);
+extern void bta_hh_security_cmpl(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_buf);
extern void bta_hh_le_notify_enc_cmpl(tBTA_HH_DEV_CB* p_cb,
- tBTA_HH_DATA* p_data);
+ const tBTA_HH_DATA* p_data);
#if (BTA_HH_DEBUG == TRUE)
extern void bta_hh_trace_dev_db(void);
*
******************************************************************************/
void bta_hh_security_cmpl(tBTA_HH_DEV_CB* p_cb,
- UNUSED_ATTR tBTA_HH_DATA* p_buf) {
+ UNUSED_ATTR const tBTA_HH_DATA* p_buf) {
APPL_TRACE_DEBUG("%s", __func__);
if (p_cb->status == BTA_HH_OK) {
if (!p_cb->hid_srvc.in_use) {
* Returns
*
******************************************************************************/
-void bta_hh_le_notify_enc_cmpl(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_buf) {
+void bta_hh_le_notify_enc_cmpl(tBTA_HH_DEV_CB* p_cb,
+ const tBTA_HH_DATA* p_buf) {
if (p_cb == NULL || !p_cb->security_pending || p_buf == NULL ||
p_buf->le_enc_cmpl.client_if != bta_hh_cb.gatt_if) {
return;
*
******************************************************************************/
void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb,
- UNUSED_ATTR tBTA_HH_DATA* p_buf) {
+ UNUSED_ATTR const tBTA_HH_DATA* p_buf) {
if (BTM_SecIsSecurityPending(p_cb->addr)) {
/* if security collision happened, wait for encryption done */
p_cb->security_pending = true;
* Parameters:
*
******************************************************************************/
-void bta_hh_gatt_open(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_buf) {
- tBTA_GATTC_OPEN* p_data = &p_buf->le_open;
- uint8_t* p2;
+void bta_hh_gatt_open(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_buf) {
+ const tBTA_GATTC_OPEN* p_data = &p_buf->le_open;
+ const uint8_t* p2;
/* if received invalid callback data , ignore it */
if (p_cb == NULL || p_data == NULL) return;
* Returns void
*
******************************************************************************/
-void bta_hh_le_open_fail(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_le_open_fail(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
tBTA_HH_CONN conn_dat;
/* open failure in the middle of service discovery, clear all services */
* Returns void
*
******************************************************************************/
-void bta_hh_gatt_close(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_gatt_close(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
tBTA_HH_CBDATA disc_dat = {BTA_HH_OK, 0};
/* deregister all notification */
* Returns void
*
******************************************************************************/
-void bta_hh_le_write_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
+void bta_hh_le_write_dev_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
switch (p_data->api_sndcmd.t_type) {
case HID_TRANS_SET_PROTOCOL:
p_cb->w4_evt = BTA_HH_SET_PROTO_EVT;
*
******************************************************************************/
uint8_t bta_hh_le_add_device(tBTA_HH_DEV_CB* p_cb,
- tBTA_HH_MAINT_DEV* p_dev_info) {
+ const tBTA_HH_MAINT_DEV* p_dev_info) {
p_cb->hid_handle = bta_hh_le_get_le_dev_hdl(p_cb->index);
if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE) return BTA_HH_INVALID_HANDLE;
bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(p_cb->hid_handle)] = p_cb->index;
static const char* bta_hh_state_code(tBTA_HH_STATE state_code);
static void bta_hh_better_state_machine(tBTA_HH_DEV_CB* p_cb, uint16_t event,
- tBTA_HH_DATA* p_data) {
+ const tBTA_HH_DATA* p_data) {
switch (p_cb->state) {
case BTA_HH_IDLE_ST:
switch (event) {
*
******************************************************************************/
void bta_hh_sm_execute(tBTA_HH_DEV_CB* p_cb, uint16_t event,
- tBTA_HH_DATA* p_data) {
+ const tBTA_HH_DATA* p_data) {
tBTA_HH cback_data;
tBTA_HH_EVT cback_event = 0;
tBTA_HH_STATE in_state;
******************************************************************************/
void bta_hh_add_device_to_list(tBTA_HH_DEV_CB* p_cb, uint8_t handle,
uint16_t attr_mask,
- tHID_DEV_DSCP_INFO* p_dscp_info,
+ const tHID_DEV_DSCP_INFO* p_dscp_info,
uint8_t sub_class, uint16_t ssr_max_latency,
uint16_t ssr_min_tout, uint8_t app_id) {
#if (BTA_HH_DEBUG == TRUE)