for (l = device_list; l != NULL; l = l->next) {
hid_connected_device_info_t *info = l->data;
- if (g_strcmp0((const char *)info->address, (const char *)remote_addr) == 0)
+ if (strcasecmp((const char *)info->address, (const char *)remote_addr) == 0)
return info;
}
return NULL;
hid_connected_device_info_t *info = NULL;
BT_CHECK_PARAMETER(remote_addr, return);
+ if (data_len > 20) {
+ BT_ERR("data(len:%d) overflow", data_len);
+ return BLUETOOTH_ERROR_INVALID_PARAM;
+ }
info = __find_hid_info_with_address(remote_addr);
if (info == NULL) {
break;
}
+ case HTYPE_TRANS_DATA: {
+ output_report.type = BT_HID_TRANS_DATA;
+ memcpy(output_report.rep_data, data, data_len);
+ bytes = write(info->ctrl_fd, &output_report.type,
+ data_len + 1);
+ break;
+ }
+
case HTYPE_TRANS_GET_IDLE: {
output_report.type = BT_HID_TRANS_DATA | BT_HID_DATA_RTYPE_OUTPUT;
output_report.rep_data[0] = data[0];