| 280 | } |
| 281 | |
| 282 | long |
| 283 | MainWindow::onRescan(FXObject *sender, FXSelector sel, void *ptr) |
| 284 | { |
| 285 | struct hid_device_info *cur_dev; |
| 286 | |
| 287 | device_list->clearItems(); |
| 288 | |
| 289 | // List the Devices |
| 290 | hid_free_enumeration(devices); |
| 291 | devices = hid_enumerate(0x0, 0x0); |
| 292 | cur_dev = devices; |
| 293 | while (cur_dev) { |
| 294 | // Add it to the List Box. |
| 295 | FXString s; |
| 296 | FXString usage_str; |
| 297 | s.format("%04hx:%04hx -", cur_dev->vendor_id, cur_dev->product_id); |
| 298 | s += FXString(" ") + cur_dev->manufacturer_string; |
| 299 | s += FXString(" ") + cur_dev->product_string; |
| 300 | usage_str.format(" (usage: %04hx:%04hx) ", cur_dev->usage_page, cur_dev->usage); |
| 301 | s += usage_str; |
| 302 | FXListItem *li = new FXListItem(s, NULL, cur_dev); |
| 303 | device_list->appendItem(li); |
| 304 | |
| 305 | cur_dev = cur_dev->next; |
| 306 | } |
| 307 | |
| 308 | if (device_list->getNumItems() == 0) |
| 309 | device_list->appendItem("*** No Devices Connected ***"); |
| 310 | else { |
| 311 | device_list->selectItem(0); |
| 312 | } |
| 313 | |
| 314 | return 1; |
| 315 | } |
| 316 | |
| 317 | size_t |
| 318 | MainWindow::getDataFromTextField(FXTextField *tf, char *buf, size_t len) |
nothing calls this directly
no test coverage detected