Add missing hid ipc doc and hal headers
cover Add missing hid ipc doc and hal headers
This patch adds missing hid ipc documentation, hal headers, renaming and virtual unplug notification in hid HAL. Unsupported methods are virtual unplug and send data in daemon.
Ravi kumar Veeramally (6):
android/hid: Add missing hid send data parameters in ipc document android/hid: Add missing parameters in send data struct in HAL headers android/hid: Fill send data structure variables in hal-hidhost android/hid: Rename virtual unplug define and struct android/hid: Add hid event virtual unplug structure to HAL msg headers android/hid: Handle virtual unplug notification in hid hal
android/hal-hidhost.c | 18 ++++++++++++++++-- android/hal-ipc-api.txt | 4 +++- android/hal-msg.h | 14 +++++++++++--- android/hid.c | 5 +++-- 4 files changed, 33 insertions(+), 8 deletions(-)
Signature · 1 line
1.8.1.2
PATCH 1/6 android/hid: Add missing hid send data parameters in ipc document
--- android/hal-ipc-api.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
android/hal-ipc-api.txt +3 -1
@@ -566,7 +566,9 @@ Commands and responses: Opcode 0x09 - Send Data command/response Command parameters: Remote address (6 octets) - ... + Report length (2 octets) + Report data (670 octets) + Response parameters: <none> In case of an error, the error response will be returned.
Signature · 1 line
1.8.1.2
PATCH 2/6 android/hid: Add missing parameters in send data struct in HAL headers
In reply to Ravi kumar Veeramally--- android/hal-msg.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
android/hal-msg.h +3 -1
@@ -298,7 +298,9 @@ struct hal_cmd_hid_set_report {#define HAL_OP_HID_SEND_DATA 0x09struct hal_cmd_hid_send_data { -uint8_t bdaddr[6 ]; +uint8_t bdaddr[6 ]; +uint16_t len; +uint8_t data[670 ]; } __attribute__((packed));#define HAL_OP_AV_CONNECT 0x01
Signature · 1 line
1.8.1.2
PATCH 3/6 android/hid: Fill send data structure variables in hal-hidhost
In reply to Ravi kumar Veeramally--- android/hal-hidhost.c | 2 ++ 1 file changed, 2 insertions(+)
android/hal-hidhost.c +2 -0
@@ -330,6 +330,8 @@ static bt_status_t hh_send_data(bt_bdaddr_t *bd_addr, char *data)return BT_STATUS_PARM_INVALID ;memcpy (cmd.bdaddr, bd_addr,sizeof (cmd.bdaddr)); + cmd.len =strlen (data); +memcpy (cmd.data, data, cmd.len);return hal_ipc_cmd (HAL_SERVICE_ID_HIDHOST ,HAL_OP_HID_SEND_DATA ,sizeof (cmd), &cmd,0 ,NULL ,NULL );
Signature · 1 line
1.8.1.2
PATCH 4/6 android/hid: Rename virtual unplug define and struct
In reply to Ravi kumar VeeramallyRenaming virtual unplug define and strcut name from VP to more meaning full.
--- android/hal-hidhost.c | 4 ++-- android/hal-msg.h | 4 ++-- android/hid.c | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-)
android/hal-hidhost.c +2 -2
@@ -140,7 +140,7 @@ static bt_status_t hh_disconnect(bt_bdaddr_t *bd_addr)static bt_status_t hh_virtual_unplug (bt_bdaddr_t *bd_addr) { -struct hal_cmd_hid_vp cmd; +struct hal_cmd_hid_virtual_unplug cmd;DBG ("" );
@@ -152,7 +152,7 @@ static bt_status_t hh_virtual_unplug(bt_bdaddr_t *bd_addr)memcpy (cmd.bdaddr, bd_addr,sizeof (cmd.bdaddr)); -return hal_ipc_cmd (HAL_SERVICE_ID_HIDHOST ,HAL_OP_HID_VP , +return hal_ipc_cmd (HAL_SERVICE_ID_HIDHOST ,HAL_OP_HID_VIRTUAL_UNPLUG ,sizeof (cmd), &cmd,0 ,NULL ,NULL ); }
android/hal-msg.h +2 -2
@@ -242,8 +242,8 @@ struct hal_cmd_hid_disconnect {uint8_t bdaddr[6 ]; } __attribute__((packed)); -#define HAL_OP_HID_VP 0x03 -struct hal_cmd_hid_vp { +#define HAL_OP_HID_VIRTUAL_UNPLUG 0x03 +struct hal_cmd_hid_virtual_unplug {uint8_t bdaddr[6 ]; } __attribute__((packed));
android/hid.c +3 -2
@@ -740,7 +740,8 @@ static uint8_t bt_hid_disconnect(struct hal_cmd_hid_disconnect *cmd,return HAL_STATUS_SUCCESS ; } -static uint8_t bt_hid_virtual_unplug (struct hal_cmd_hid_vp *cmd,uint16_t len) +static uint8_t bt_hid_virtual_unplug (struct hal_cmd_hid_virtual_unplug *cmd, +uint16_t len) {DBG ("Not Implemented" );
@@ -938,7 +939,7 @@ void bt_hid_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len)case HAL_OP_HID_DISCONNECT : status =bt_hid_disconnect (buf, len);break ; -case HAL_OP_HID_VP : +case HAL_OP_HID_VIRTUAL_UNPLUG : status =bt_hid_virtual_unplug (buf, len);break ;case HAL_OP_HID_SET_INFO :
Signature · 1 line
1.8.1.2
PATCH 5/6 android/hid: Add hid event virtual unplug structure to HAL msg headers
In reply to Ravi kumar Veeramally--- android/hal-msg.h | 6 ++++++ 1 file changed, 6 insertions(+)
android/hal-msg.h +6 -0
@@ -477,6 +477,12 @@ struct hal_ev_hid_get_report {uint8_t data[0 ]; } __attribute__((packed)); +#define HAL_EV_HID_VIRTUAL_UNPLUG 0x86 +struct hal_ev_hid_virtual_unplug { +uint8_t bdaddr[6 ]; +uint8_t status; +} __attribute__((packed)); +#define HAL_EV_AV_CONNECTION_STATE 0x81struct hal_ev_av_connection_state {uint8_t state;
Signature · 1 line
1.8.1.2
PATCH 6/6 android/hid: Handle virtual unplug notification in hid hal
In reply to Ravi kumar Veeramally--- android/hal-hidhost.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
android/hal-hidhost.c +12 -0
@@ -77,6 +77,15 @@ static void handle_get_report(void *buf) ev->status, ev->data, ev->len); } +static void handle_virtual_unplug (void *buf) +{ +struct hal_ev_hid_virtual_unplug *ev = buf; + +if (bt_hh_cbacks->virtual_unplug_cb) + bt_hh_cbacks->virtual_unplug_cb ((bt_bdaddr_t *) ev->bdaddr, + ev->status); +} +/* will be called from notification thread context */ void bt_notify_hh (uint16_t opcode,void *buf,uint16_t len) {
@@ -96,6 +105,9 @@ void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)case HAL_EV_HID_GET_REPORT :handle_get_report (buf);break ; +case HAL_EV_HID_VIRTUAL_UNPLUG : +handle_virtual_unplug (buf); +break ;default :DBG ("Unhandled callback opcode=0x%x" , opcode);break ;
Signature · 1 line
1.8.1.2