diff options
Diffstat (limited to 'bta/hh/bta_hh_api.c')
-rw-r--r-- | bta/hh/bta_hh_api.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/bta/hh/bta_hh_api.c b/bta/hh/bta_hh_api.c index 8effda9..c84243d 100644 --- a/bta/hh/bta_hh_api.c +++ b/bta/hh/bta_hh_api.c @@ -34,11 +34,11 @@ static const tBTA_SYS_REG bta_hh_reg = ** ** Function BTA_HhEnable ** -** Description Enable the HID host. This function must be called before -** any other functions in the HID host API are called. When the -** enable operation is complete the callback function will be +** Description Enable the HID host. This function must be called before +** any other functions in the HID host API are called. When the +** enable operation is complete the callback function will be ** called with BTA_HH_ENABLE_EVT. -** +** ** ** Returns void ** @@ -93,7 +93,7 @@ void BTA_HhDisable(void) ** ** Function BTA_HhClose ** -** Description Disconnect a connection. +** Description Disconnect a connection. ** ** Returns void ** @@ -127,7 +127,7 @@ void BTA_HhOpen(BD_ADDR dev_bda, tBTA_HH_PROTO_MODE mode, tBTA_SEC sec_mask) tBTA_HH_API_CONN *p_buf; p_buf = (tBTA_HH_API_CONN *)GKI_getbuf((UINT16)sizeof(tBTA_HH_API_CONN)); - + if (p_buf!= NULL) { memset((void *)p_buf, 0, sizeof(tBTA_HH_API_CONN)); @@ -151,12 +151,12 @@ void BTA_HhOpen(BD_ADDR dev_bda, tBTA_HH_PROTO_MODE mode, tBTA_SEC sec_mask) ** Function bta_hh_snd_write_dev ** *******************************************************************************/ -static void bta_hh_snd_write_dev(UINT8 dev_handle, UINT8 t_type, UINT8 param, +static void bta_hh_snd_write_dev(UINT8 dev_handle, UINT8 t_type, UINT8 param, UINT16 data, UINT8 rpt_id, BT_HDR *p_data) { tBTA_HH_CMD_DATA *p_buf; UINT16 len = (UINT16) (sizeof(tBTA_HH_CMD_DATA) ); - + if ((p_buf = (tBTA_HH_CMD_DATA *)GKI_getbuf(len))!= NULL) { memset(p_buf, 0, sizeof(tBTA_HH_CMD_DATA)); @@ -179,7 +179,7 @@ static void bta_hh_snd_write_dev(UINT8 dev_handle, UINT8 t_type, UINT8 param, ** Description send SET_REPORT to device. ** ** Parameter dev_handle: device handle -** r_type: report type, could be BTA_HH_RPTT_OUTPUT or +** r_type: report type, could be BTA_HH_RPTT_OUTPUT or ** BTA_HH_RPTT_FEATURE. ** Returns void ** @@ -192,7 +192,7 @@ void BTA_HhSetReport(UINT8 dev_handle, tBTA_HH_RPT_TYPE r_type, BT_HDR *p_data) ** ** Function BTA_HhGetReport ** -** Description Send a GET_REPORT to HID device. +** Description Send a GET_REPORT to HID device. ** ** Returns void ** @@ -201,8 +201,8 @@ void BTA_HhGetReport(UINT8 dev_handle, tBTA_HH_RPT_TYPE r_type, UINT8 rpt_id, UI { UINT8 param = (buf_size) ? (r_type | 0x08) : r_type; - bta_hh_snd_write_dev(dev_handle, HID_TRANS_GET_REPORT, param, - buf_size, rpt_id, NULL); + bta_hh_snd_write_dev(dev_handle, HID_TRANS_GET_REPORT, param, + buf_size, rpt_id, NULL); } /******************************************************************************* ** @@ -215,7 +215,7 @@ void BTA_HhGetReport(UINT8 dev_handle, tBTA_HH_RPT_TYPE r_type, UINT8 rpt_id, UI *******************************************************************************/ void BTA_HhSetProtoMode(UINT8 dev_handle, tBTA_HH_PROTO_MODE p_type) { - bta_hh_snd_write_dev(dev_handle, HID_TRANS_SET_PROTOCOL, (UINT8)p_type, + bta_hh_snd_write_dev(dev_handle, HID_TRANS_SET_PROTOCOL, (UINT8)p_type, 0, 0, NULL); } /******************************************************************************* @@ -312,15 +312,15 @@ void BTA_HhGetDscpInfo(UINT8 dev_handle) ** ** Function BTA_HhAddDev ** -** Description Add a virtually cabled device into HID-Host device list -** to manage and assign a device handle for future API call, -** host applciation call this API at start-up to initialize its -** virtually cabled devices. +** Description Add a virtually cabled device into HID-Host device list +** to manage and assign a device handle for future API call, +** host applciation call this API at start-up to initialize its +** virtually cabled devices. ** ** Returns void ** *******************************************************************************/ -void BTA_HhAddDev(BD_ADDR bda, tBTA_HH_ATTR_MASK attr_mask, UINT8 sub_class, +void BTA_HhAddDev(BD_ADDR bda, tBTA_HH_ATTR_MASK attr_mask, UINT8 sub_class, UINT8 app_id, tBTA_HH_DEV_DSCP_INFO dscp_info) { tBTA_HH_MAINT_DEV *p_buf; @@ -333,7 +333,7 @@ void BTA_HhAddDev(BD_ADDR bda, tBTA_HH_ATTR_MASK attr_mask, UINT8 sub_class, memset(p_buf, 0, sizeof(tBTA_HH_MAINT_DEV)); p_buf->hdr.event = BTA_HH_API_MAINT_DEV_EVT; - p_buf->sub_event = BTA_HH_ADD_DEV_EVT; + p_buf->sub_event = BTA_HH_ADD_DEV_EVT; p_buf->hdr.layer_specific = BTA_HH_INVALID_HANDLE; p_buf->attr_mask = (UINT16) attr_mask; @@ -361,7 +361,7 @@ void BTA_HhAddDev(BD_ADDR bda, tBTA_HH_ATTR_MASK attr_mask, UINT8 sub_class, ** ** Function BTA_HhRemoveDev ** -** Description Remove a device from the HID host devices list. +** Description Remove a device from the HID host devices list. ** ** Returns void ** @@ -377,11 +377,11 @@ void BTA_HhRemoveDev(UINT8 dev_handle ) memset(p_buf, 0, sizeof(tBTA_HH_MAINT_DEV)); p_buf->hdr.event = BTA_HH_API_MAINT_DEV_EVT; - p_buf->sub_event = BTA_HH_RMV_DEV_EVT; + p_buf->sub_event = BTA_HH_RMV_DEV_EVT; p_buf->hdr.layer_specific = (UINT16) dev_handle; bta_sys_sendmsg(p_buf); - } + } } /*******************************************************************************/ @@ -393,21 +393,21 @@ void BTA_HhRemoveDev(UINT8 dev_handle ) ** Function BTA_HhParseBootRpt ** ** Description This utility function parse a boot mode report. -** For keyboard report, report data will carry the keycode max -** up to 6 key press in one report. Application need to convert -** the keycode into keypress character according to keyboard +** For keyboard report, report data will carry the keycode max +** up to 6 key press in one report. Application need to convert +** the keycode into keypress character according to keyboard ** language. ** ** Returns void ** *******************************************************************************/ -void BTA_HhParseBootRpt(tBTA_HH_BOOT_RPT *p_data, UINT8 *p_report, +void BTA_HhParseBootRpt(tBTA_HH_BOOT_RPT *p_data, UINT8 *p_report, UINT16 report_len) { p_data->dev_type = BTA_HH_DEVT_UNKNOWN; if (p_report) - { + { /* first byte is report ID */ switch (p_report[0]) { @@ -426,7 +426,7 @@ void BTA_HhParseBootRpt(tBTA_HH_BOOT_RPT *p_data, UINT8 *p_report, break; } } - + return; } |