devices Endpoint¶
The devices
endpoint provides a list of all USB devices attached to the host system,
including device information, port path, capabilities, and mappings to Acroname devices.
There are no input parameters to this endpoint. It will return a JSON array of devices, encapsulated in a transaction envelope.
JSON Schema for Response Object¶
The following table lists a JSON Schema for the response object.
Download the raw JSON Schema file for this response: devices_response.json
Object Fields of Devices Response¶
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
Array<Object> |
Yes |
An array containing all USB devices in the system |
Object Fields of usb[]
¶
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
Yes |
Vendor Identifier |
|
|
Yes |
Product Identifier |
|
|
Yes |
Current enumerated speed |
|
|
Yes |
Maximum supported speed |
|
|
Yes |
Vendor-provided serial number |
|
|
Yes |
Vendor-provided manufacturer name |
|
|
Yes |
Vendor-provided product name |
|
|
Yes |
Device Class Code |
|
|
Array<Object> |
Yes |
List of all interfaces provided by device |
|
Array<v1-uint8> |
Yes |
List of the logical IDs of each parent node, starting with the controller ID and followed by the port ID for each parent device. |
|
No |
If an Acroname device is detected in this device’s parent tree, information about the Acroname device. |
|
|
Yes |
Capability information for Bulk Transfers |
|
|
Yes |
Capability information for Isochronous Transfers |
|
|
Yes |
Capability information for Interrupt Transfers |
Object Fields of usb[].interfaces[]
¶
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
Yes |
Interface Index within this device |
|
|
Yes |
Alternate Setting Index within this interface |
|
|
Yes |
USB-IF class code for this interface |
|
|
Yes |
USB-IF subclass code for this interface, qualified by the kClass code |
|
|
Yes |
USB-IF protocol code for this interface, qualified by the kClass and kSubclass codes |
Object Fields of usb[].acronameDevice
¶
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
Yes |
Acroname Serial Number |
|
|
Yes |
Physical port number on the Acroname device |
|
|
Yes |
Number of parent tiers between Acroanme device and this device |
v1-vidPid¶
Name |
Value |
---|---|
Type |
string |
description |
Representation of a USB Device or Vendor ID |
Regular Expression |
|
v1-serialNumber¶
Name |
Value |
---|---|
Type |
string |
description |
Representation of an Acroname device serial number |
Regular Expression |
|
v1-speed¶
Name |
Value |
---|---|
Type |
string |
description |
Enumeration of all possible USB speeds |
Enumerations |
|
v1-name¶
Name |
Value |
---|---|
Type |
string |
description |
USB-IF Compliant Name Field |
Maximum # of Glyphs |
|
v1-classCode¶
Name |
Value |
---|---|
Type |
integer |
description |
Enumeration of all possible USB device/interface classes (https://vovkos.github.io/doxyrest/samples/libusb/enum_libusb_class_code.html) |
Enumerations |
|
v1-uint8¶
Name |
Value |
---|---|
Type |
integer |
description |
Unsigned 8-bit integer |
minimum |
0 |
maximum |
255 |
v1-capability¶
Name |
Value |
---|---|
Type |
|
description |
Description for a capability of a device |
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
boolean |
Yes |
Whether the device is currently using this capability |
|
boolean |
Yes |
Whether the device is capable of using this capability |
v1-aErr¶
Name |
Value |
---|---|
Type |
string |
description |
Enumeration of all possible error results |
Enumerations |
|
v1-error¶
Name |
Value |
---|---|
Type |
|
description |
Error containing an acroname error |
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
Yes |
Acroname error code |
|
|
string |
No |
A human-readable message to describe the context of the error. |
Examples¶
curl http://127.0.0.1:9005/api/v1/devices
import requests
import json
response = requests.get('http://127.0.0.1:9005/api/v1/devices')
json_data = response.json()
print(json.dumps(json_data, indent=4))
The output will be similar to the following:
1{
2 "timestamp": "2023-09-20T17:36:15.359Z",
3 "request": {
4 "endpointName": "/api/v1/devices",
5 "parameters": {}
6 },
7 "response": {
8 "usb": [
9 {
10 "vendorId": "0x067B",
11 "productId": "0x2303",
12 "speedActual": "12 Mbps",
13 "maxSpeed": "12 Mbps",
14 "productName": "USB-Serial Controller",
15 "serialNumber": "",
16 "manufacturer": "Prolific Technology Inc.",
17 "deviceClass": 0,
18 "interfaces": [
19 {
20 "interfaceIndex": 0,
21 "entryIndex": 0,
22 "kClass": 255,
23 "kSubclass": 0,
24 "kProtocol": 0
25 }
26 ],
27 "portPath": [
28 4,
29 3,
30 1
31 ],
32 "acronameDevice": {
33 "serialNumber": "0xF7D9AFB6",
34 "port": 0,
35 "distance": 0
36 },
37 "bulkCapability": {
38 "isDoing": true,
39 "isCapable": true
40 },
41 "isochronousCapability": {
42 "isDoing": false,
43 "isCapable": false
44 },
45 "interruptCapability": {
46 "isDoing": true,
47 "isCapable": true
48 }
49 },
50 {
51 "vendorId": "0x2188",
52 "productId": "0x0747",
53 "speedActual": "5 Gbps",
54 "maxSpeed": "5 Gbps",
55 "productName": "Card Reader ",
56 "serialNumber": "000000000010",
57 "manufacturer": "CalDigit",
58 "deviceClass": 0,
59 "interfaces": [
60 {
61 "interfaceIndex": 0,
62 "entryIndex": 0,
63 "kClass": 8,
64 "kSubclass": 6,
65 "kProtocol": 80
66 }
67 ],
68 "portPath": [
69 4,
70 8
71 ],
72 "bulkCapability": {
73 "isDoing": true,
74 "isCapable": true
75 },
76 "isochronousCapability": {
77 "isDoing": false,
78 "isCapable": false
79 },
80 "interruptCapability": {
81 "isDoing": false,
82 "isCapable": false
83 }
84 }
85 ]
86 }
87}