break;
}
+ case BT_HID_TRANS_GET_IDLE:{
+ BT_INFO("Get_IDLE");
+ data.type = HTYPE_TRANS_GET_IDLE;
+ data.param = PTYPE_DATA_RTYPE_INPUT;
+ data.buffer_size = len;
+ data.buffer = (char *) malloc(sizeof(char) * len);
+ if (data.buffer)
+ memcpy(data.buffer, buffer, len);
+ break;
+ }
+
+ case BT_HID_TRANS_SET_IDLE:{
+ BT_INFO("Set_IDLE");
+ data.type = HTYPE_TRANS_SET_IDLE;
+ data.param = PTYPE_DATA_RTYPE_INPUT;
+ data.buffer_size = len;
+ data.buffer = (char *) malloc(sizeof(char) * len);
+ if (data.buffer)
+ memcpy(data.buffer, buffer, len);
+ break;
+ }
+
default: {
BT_INFO("unsupported HIDP control message");
BT_ERR("Send Handshake Message");
{
int result;
struct reports output_report = { 0 };
- int bytes = 0;
+ int bytes = BLUETOOTH_ERROR_INTERNAL;
hid_connected_device_info_t *info = NULL;
info = __find_hid_info_with_address(remote_addr);
if (info == NULL) {
BT_DBG("Bytes Written %d", bytes);
break;
}
+
+ case HTYPE_TRANS_GET_IDLE: {
+ BT_DBG("Replying to Get_IDLE");
+ output_report.type = BT_HID_TRANS_DATA | BT_HID_DATA_RTYPE_OUTPUT;
+ output_report.rep_data[0] = data[0];
+ bytes = write(info->intr_fd, &output_report, 2);
+ BT_DBG("Bytes Written %d", bytes);
+ break;
+ }
+
+ case HTYPE_TRANS_SET_IDLE: {
+ BT_DBG("Reply to Set_IDLE");
+ output_report.type = BT_HID_TRANS_DATA | BT_HID_DATA_RTYPE_INPUT;
+ memcpy(output_report.rep_data, data, data_len);
+ bytes = write(info->ctrl_fd, &output_report,
+ sizeof(output_report));
+ BT_DBG("Bytes Written %d", bytes);
+ break;
+ }
+
default:
break;
}