Skip to content

Instantly share code, notes, and snippets.

Created October 19, 2015 11:37
Show Gist options
  • Save anonymous/836ec84e046a5866874c to your computer and use it in GitHub Desktop.
Save anonymous/836ec84e046a5866874c to your computer and use it in GitHub Desktop.
struct hid_device_info *devs, *cur_dev;
std::vector<HIDDeviceInfo> founded;
while(!stopped){
devs = hid_enumerate(0x0, 0x0);
cur_dev = devs;
founded.clear();
while (cur_dev) {
qDebug("VID = %04hX PID = %04hX", cur_dev->vendor_id, cur_dev->product_id);
HIDDeviceInfo hid_device(cur_dev); //достаточно закомментировать эту строку и перестает падать
founded.push_back(hid_device);
cur_dev = cur_dev->next; //перед падением структура cur_dev содержит хуиту, но достаточно убрать строку 9 и 10 и все ок
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment