Skip to content

Commit

Permalink
Moved the list-deletion code from two places to one place. Added a co…
Browse files Browse the repository at this point in the history
…mmented-out listing of devices found.
  • Loading branch information
russell-taylor committed Apr 30, 2011
1 parent 4662495 commit e3339bd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions vrpn_HumanInterface.C
Expand Up @@ -61,6 +61,7 @@ void vrpn_HidInterface::reconnect() {
device_info.serial_number = loop->serial_number;
device_info.manufacturer_string = loop->manufacturer_string;
device_info.product_string = loop->product_string;
//printf("XXX Found vendor %x, product %x\n", (unsigned)(loop->vendor_id), (unsigned)(loop->product_id));

if (_acceptor->accept(device_info)) {
_vendor = loop->vendor_id;
Expand All @@ -70,19 +71,17 @@ void vrpn_HidInterface::reconnect() {
}
loop = loop->next;
}
if (devs != NULL) {
hid_free_enumeration(devs);
devs = NULL;
}
if (!found) {
fprintf(stderr,"vrpn_HidInterface::reconnect(): Device not found\n");
if (devs != NULL) {
hid_free_enumeration(devs);
}
return;
}

// Initialize the HID interface and open the device.
_device = hid_open(_vendor, _product, const_cast<wchar_t *>(serial));
if (devs != NULL) {
hid_free_enumeration(devs);
}
if (_device == NULL) {
fprintf(stderr,"vrpn_HidInterface::reconnect(): Could not open device\n");
#ifdef linux
Expand Down

0 comments on commit e3339bd

Please sign in to comment.