1 struct hid_device_info *device_info = (struct hid_device_info*) item->getData();2 if (!device_info)3 return -1;4 5 connected_device = hid_open_path(device_info->path);