-typedef enum
-{
- BTHH_CONN_STATE_CONNECTED = 0,
- BTHH_CONN_STATE_CONNECTING,
- BTHH_CONN_STATE_DISCONNECTED,
- BTHH_CONN_STATE_DISCONNECTING,
- BTHH_CONN_STATE_FAILED_MOUSE_FROM_HOST,
- BTHH_CONN_STATE_FAILED_KBD_FROM_HOST,
- BTHH_CONN_STATE_FAILED_TOO_MANY_DEVICES,
- BTHH_CONN_STATE_FAILED_NO_BTHID_DRIVER,
- BTHH_CONN_STATE_FAILED_GENERIC,
- BTHH_CONN_STATE_UNKNOWN
+typedef enum {
+ BTHH_CONN_STATE_CONNECTED = 0,
+ BTHH_CONN_STATE_CONNECTING,
+ BTHH_CONN_STATE_DISCONNECTED,
+ BTHH_CONN_STATE_DISCONNECTING,
+ BTHH_CONN_STATE_FAILED_MOUSE_FROM_HOST,
+ BTHH_CONN_STATE_FAILED_KBD_FROM_HOST,
+ BTHH_CONN_STATE_FAILED_TOO_MANY_DEVICES,
+ BTHH_CONN_STATE_FAILED_NO_BTHID_DRIVER,
+ BTHH_CONN_STATE_FAILED_GENERIC,
+ BTHH_CONN_STATE_UNKNOWN
-typedef enum
-{
- BTHH_OK = 0,
- BTHH_HS_HID_NOT_READY, /* handshake error : device not ready */
- BTHH_HS_INVALID_RPT_ID, /* handshake error : invalid report ID */
- BTHH_HS_TRANS_NOT_SPT, /* handshake error : transaction not spt */
- BTHH_HS_INVALID_PARAM, /* handshake error : invalid paremter */
- BTHH_HS_ERROR, /* handshake error : unspecified HS error */
- BTHH_ERR, /* general BTA HH error */
- BTHH_ERR_SDP, /* SDP error */
- BTHH_ERR_PROTO, /* SET_Protocol error,
- only used in BTA_HH_OPEN_EVT callback */
- BTHH_ERR_DB_FULL, /* device database full error, used */
- BTHH_ERR_TOD_UNSPT, /* type of device not supported */
- BTHH_ERR_NO_RES, /* out of system resources */
- BTHH_ERR_AUTH_FAILED, /* authentication fail */
- BTHH_ERR_HDL
-}bthh_status_t;
+typedef enum {
+ BTHH_OK = 0,
+ BTHH_HS_HID_NOT_READY, /* handshake error : device not ready */
+ BTHH_HS_INVALID_RPT_ID, /* handshake error : invalid report ID */
+ BTHH_HS_TRANS_NOT_SPT, /* handshake error : transaction not spt */
+ BTHH_HS_INVALID_PARAM, /* handshake error : invalid paremter */
+ BTHH_HS_ERROR, /* handshake error : unspecified HS error */
+ BTHH_ERR, /* general BTA HH error */
+ BTHH_ERR_SDP, /* SDP error */
+ BTHH_ERR_PROTO, /* SET_Protocol error,
+ only used in BTA_HH_OPEN_EVT callback */
+ BTHH_ERR_DB_FULL, /* device database full error, used */
+ BTHH_ERR_TOD_UNSPT, /* type of device not supported */
+ BTHH_ERR_NO_RES, /* out of system resources */
+ BTHH_ERR_AUTH_FAILED, /* authentication fail */
+ BTHH_ERR_HDL
+} bthh_status_t;
- BTHH_REPORT_MODE = 0x00,
- BTHH_BOOT_MODE = 0x01,
- BTHH_UNSUPPORTED_MODE = 0xff
-}bthh_protocol_mode_t;
+ BTHH_REPORT_MODE = 0x00,
+ BTHH_BOOT_MODE = 0x01,
+ BTHH_UNSUPPORTED_MODE = 0xff
+} bthh_protocol_mode_t;
/** Callback for get hid info
* hid_info will contain attr_mask, sub_class, app_id, vendor_id, product_id, version, ctry_code, len
*/
/** Callback for get hid info
* hid_info will contain attr_mask, sub_class, app_id, vendor_id, product_id, version, ctry_code, len
*/
-typedef void (* bthh_get_report_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, uint8_t* rpt_data, int rpt_size);
+typedef void (*bthh_get_report_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, uint8_t* rpt_data, int rpt_size);
- /** set to sizeof(BtHfCallbacks) */
- size_t size;
- bthh_connection_state_callback connection_state_cb;
- bthh_hid_info_callback hid_info_cb;
- bthh_protocol_mode_callback protocol_mode_cb;
- bthh_idle_time_callback idle_time_cb;
- bthh_get_report_callback get_report_cb;
- bthh_virtual_unplug_callback virtual_unplug_cb;
- bthh_handshake_callback handshake_cb;
+ /** set to sizeof(BtHfCallbacks) */
+ size_t size;
+ bthh_connection_state_callback connection_state_cb;
+ bthh_hid_info_callback hid_info_cb;
+ bthh_protocol_mode_callback protocol_mode_cb;
+ bthh_idle_time_callback idle_time_cb;
+ bthh_get_report_callback get_report_cb;
+ bthh_virtual_unplug_callback virtual_unplug_cb;
+ bthh_handshake_callback handshake_cb;
- /** Set the HID device descriptor for the specified HID device. */
- bt_status_t (*set_info)(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info );
+ /** Set the HID device descriptor for the specified HID device. */
+ bt_status_t (*set_info)(bt_bdaddr_t *bd_addr, bthh_hid_info_t *hid_info);
- /** Get the HID proto mode. */
- bt_status_t (*get_protocol) (bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode);
+ /** Get the HID proto mode. */
+ bt_status_t (*get_protocol) (bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode);
- /** Set the HID proto mode. */
- bt_status_t (*set_protocol)(bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode);
+ /** Set the HID proto mode. */
+ bt_status_t (*set_protocol)(bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode);
- /** Send a GET_REPORT to HID device. */
- bt_status_t (*get_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, uint8_t reportId, int bufferSize);
+ /** Send a GET_REPORT to HID device. */
+ bt_status_t (*get_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, uint8_t reportId, int bufferSize);
- /** Send a SET_REPORT to HID device. */
- bt_status_t (*set_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, char* report);
+ /** Send a SET_REPORT to HID device. */
+ bt_status_t (*set_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, char* report);
- /** Send data to HID device. */
- bt_status_t (*send_data)(bt_bdaddr_t *bd_addr, char* data);
+ /** Send data to HID device. */
+ bt_status_t (*send_data)(bt_bdaddr_t *bd_addr, char* data);