17 "title" :
"HID Device",
18 "description" :
"Information about a USB HID device.",
36 if (strcmp(json_object_get_string(js),
"location") == 0)
37 return VuoHidDevice_MatchLocation;
39 return VuoHidDevice_MatchName;
47 if (type == VuoHidDevice_MatchLocation)
86 json_object_object_add(js,
"matchType", matchTypeObject);
91 json_object_object_add(js,
"name", o);
97 json_object_object_add(js,
"location", o);
103 json_object_object_add(js,
"controls", o);
109 json_object_object_add(js,
"vendorID", o);
115 json_object_object_add(js,
"productID", o);
121 json_object_object_add(js,
"usagePage", o);
127 json_object_object_add(js,
"usage", o);
187 if (device.
matchType == VuoHidDevice_MatchLocation)
193 realizedDevice->vendorID = device.vendorID;
194 realizedDevice->productID = device.productID;
195 realizedDevice->usagePage = device.usagePage;
196 realizedDevice->usage = device.usage;
209 if (deviceCount == 0)
211 VUserLog(
"Warning: No HID devices found.");
217 for (
unsigned long i = 1; i <= deviceCount; ++i)
222 realizedDevice->
matchType = VuoHidDevice_MatchLocation;
226 realizedDevice->vendorID = d.vendorID;
227 realizedDevice->productID = d.productID;
228 realizedDevice->usagePage = d.usagePage;
229 realizedDevice->usage = d.usage;
255 char *outputText = strdup(realizedDevice.
name);
261 return strdup(value.
name);
263 return strdup(
"Unknown device");