MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / onRescan

Method onRescan

lib/hidapi/testgui/test.cpp:282–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282long
283MainWindow::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
317size_t
318MainWindow::getDataFromTextField(FXTextField *tf, char *buf, size_t len)

Callers

nothing calls this directly

Calls 3

hid_free_enumerationFunction · 0.50
hid_enumerateFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected