/****************************************************************************** * * Copyright (C) 2016 The Android Open Source Project * Copyright (C) 2005-2012 Broadcom Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************//* ... *//****************************************************************************** * * This file contains BTA HID Device internal definitions * ******************************************************************************//* ... */#ifndefBTA_HD_INT_H#defineBTA_HD_INT_H#include"bta/bta_hd_api.h"#include"bta/bta_sys.h"#include"stack/hiddefs.h"enum{BTA_HD_API_REGISTER_APP_EVT=BTA_SYS_EVT_START(BTA_ID_HD),BTA_HD_API_UNREGISTER_APP_EVT,BTA_HD_API_CONNECT_EVT,BTA_HD_API_DISCONNECT_EVT,BTA_HD_API_ADD_DEVICE_EVT,BTA_HD_API_REMOVE_DEVICE_EVT,BTA_HD_API_SEND_REPORT_EVT,BTA_HD_API_REPORT_ERROR_EVT,BTA_HD_API_VC_UNPLUG_EVT,BTA_HD_INT_OPEN_EVT,BTA_HD_INT_CLOSE_EVT,BTA_HD_INT_INTR_DATA_EVT,BTA_HD_INT_GET_REPORT_EVT,BTA_HD_INT_SET_REPORT_EVT,BTA_HD_INT_SET_PROTOCOL_EVT,BTA_HD_INT_VC_UNPLUG_EVT,BTA_HD_INT_SUSPEND_EVT,BTA_HD_INT_EXIT_SUSPEND_EVT,/* handled outside state machine */BTA_HD_API_ENABLE_EVT,BTA_HD_API_DISABLE_EVT}{ ... };typedefuint16_ttBTA_HD_INT_EVT;#defineBTA_HD_INVALID_EVT(BTA_HD_API_DISABLE_EVT+1)typedefstruct{BT_HDRhdr;tBTA_HD_CBACK*p_cback;}{ ... }tBTA_HD_API_ENABLE;#defineBTA_HD_APP_NAME_LEN50#defineBTA_HD_APP_DESCRIPTION_LEN50#defineBTA_HD_APP_PROVIDER_LEN50#defineBTA_HD_APP_DESCRIPTOR_LEN2048#defineBTA_HD_STATE_DISABLED0x00#defineBTA_HD_STATE_ENABLED0x01#defineBTA_HD_STATE_IDLE0x02#defineBTA_HD_STATE_CONNECTED0x03#defineBTA_HD_STATE_DISABLING0x04#defineBTA_HD_STATE_REMOVING0x0510 definestypedefstruct{BT_HDRhdr;charname[BTA_HD_APP_NAME_LEN+1];chardescription[BTA_HD_APP_DESCRIPTION_LEN+1];charprovider[BTA_HD_APP_PROVIDER_LEN+1];uint8_tsubclass;uint16_td_len;uint8_td_data[BTA_HD_APP_DESCRIPTOR_LEN];tBTA_HD_QOS_INFOin_qos;tBTA_HD_QOS_INFOout_qos;}{ ... }tBTA_HD_REGISTER_APP;#defineBTA_HD_REPORT_LENHID_DEV_MTU_SIZEtypedefstruct{BT_HDRhdr;booluse_intr;uint8_ttype;uint8_tid;uint16_tlen;uint8_tdata[BTA_HD_REPORT_LEN];}{ ... }tBTA_HD_SEND_REPORT;typedefstruct{BT_HDRhdr;BD_ADDRaddr;}{ ... }tBTA_HD_DEVICE_CTRL;typedefstruct{BT_HDRhdr;uint8_terror;}{ ... }tBTA_HD_REPORT_ERR;/* union of all event data types */typedefunion{BT_HDRhdr;tBTA_HD_API_ENABLEapi_enable;tBTA_HD_REGISTER_APPregister_app;tBTA_HD_SEND_REPORTsend_report;tBTA_HD_DEVICE_CTRLdevice_ctrl;tBTA_HD_REPORT_ERRreport_err;}{ ... }tBTA_HD_DATA;typedefstruct{BT_HDRhdr;BD_ADDRaddr;uint32_tdata;BT_HDR*p_data;}{ ... }tBTA_HD_CBACK_DATA;/****************************************************************************** * Main Control Block ******************************************************************************//* ... */typedefstruct{tBTA_HD_CBACK*p_cback;uint32_tsdp_handle;uint8_ttrace_level;uint8_tstate;BD_ADDRbd_addr;booluse_report_id;boolboot_mode;boolvc_unplug;booldisable_w4_close;}{ ... }tBTA_HD_CB;#ifBTA_DYNAMIC_MEMORY==FALSEexterntBTA_HD_CBbta_hd_cb;#elseexterntBTA_HD_CB*bta_hd_cb_ptr;#definebta_hd_cb(*bta_hd_cb_ptr)/* ... */#endif/***************************************************************************** * Function prototypes ****************************************************************************//* ... */externboolbta_hd_hdl_event(BT_HDR*p_msg);externvoidbta_hd_api_enable(tBTA_HD_DATA*p_data);externvoidbta_hd_api_disable(void);externvoidbta_hd_register_act(tBTA_HD_DATA*p_data);externvoidbta_hd_unregister_act(tBTA_HD_DATA*p_data);externvoidbta_hd_unregister2_act(tBTA_HD_DATA*p_data);externvoidbta_hd_connect_act(tBTA_HD_DATA*p_data);externvoidbta_hd_disconnect_act(tBTA_HD_DATA*p_data);externvoidbta_hd_add_device_act(tBTA_HD_DATA*p_data);externvoidbta_hd_remove_device_act(tBTA_HD_DATA*p_data);externvoidbta_hd_send_report_act(tBTA_HD_DATA*p_data);externvoidbta_hd_report_error_act(tBTA_HD_DATA*p_data);externvoidbta_hd_vc_unplug_act(tBTA_HD_DATA*p_data);externvoidbta_hd_open_act(tBTA_HD_DATA*p_data);externvoidbta_hd_close_act(tBTA_HD_DATA*p_data);externvoidbta_hd_intr_data_act(tBTA_HD_DATA*p_data);externvoidbta_hd_get_report_act(tBTA_HD_DATA*p_data);externvoidbta_hd_set_report_act(tBTA_HD_DATA*p_data);externvoidbta_hd_set_protocol_act(tBTA_HD_DATA*p_data);externvoidbta_hd_vc_unplug_done_act(tBTA_HD_DATA*p_data);externvoidbta_hd_suspend_act(tBTA_HD_DATA*p_data);externvoidbta_hd_exit_suspend_act(tBTA_HD_DATA*p_data);externvoidbta_hd_open_failure(tBTA_HD_DATA*p_data);/* ... */#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.