acronameDevicesState Endpoint¶
The acronameDevicesState
endpoint provides telemetry and state information for all
of the attached Acroname devices on the host system. It provides USB connection information,
custom names, and device version information for each port on the device.
There are no input parameters to this endpoint. It will return a JSON array of devices, or error, 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: acroname_devices_state_response.json
Object Fields of Acroname Devices State Response¶
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
Yes |
Time and date that this object was created. |
|
|
Yes |
Sequence counter that increments on each message sent. |
|
|
Yes |
Version of the BrainStem library for this object. |
|
|
Array<Object> |
Yes |
Array containing all the available Acroname devices on the system. |
Object Fields of acronameDevices[]
¶
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
Yes |
Acroname Serial Number |
|
|
Yes |
Firmware version that is running on the device. |
|
|
Yes |
Model Name of the device. |
|
|
string |
No |
If set, a user-defined name for the device. |
|
No |
Currently active upstream port index. |
|
|
boolean |
Yes |
Is upstream port selected automatically. |
|
Array<Object> |
No |
Object representing a single port on a device. |
Object Fields of acronameDevices[].ports[]
¶
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
Yes |
Physical Port Number on device. This may include upstream ports, control ports, etc. |
|
|
string |
Yes |
Description of the port type and number. |
|
string |
No |
If set, a user-defined name for the port. |
|
string |
No |
Current data speed of the port. |
|
Array<v1-dataRole> |
Yes |
All supported data roles of the port. |
|
Yes |
Current data role of the port. |
|
|
boolean |
No |
Whether or not the port is enabled. |
|
No |
Voltage measurement from this port. |
|
|
No |
Current measurement from this port. |
v1-timestamp¶
Name |
Value |
---|---|
Type |
string |
description |
String containing a ISO8601 timestamp (YYYY-MM-DDTHH:MM:SS.mmmZ |
Regular Expression |
|
v1-serialNumber¶
Name |
Value |
---|---|
Type |
string |
description |
Hexadecimal representation of an Acroname device. |
Regular Expression |
|
v1-version¶
Name |
Value |
---|---|
Type |
|
description |
Object representing a <major>.<minor>.<patch> semantic version. |
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
Yes |
||
|
Yes |
||
|
Yes |
v1-model¶
Name |
Value |
---|---|
Type |
string |
description |
Enumeration of all supported Acroname devices. |
Enumerations |
|
v1-dataRole¶
Name |
Value |
---|---|
Type |
string |
description |
Enumeration of all supported data roles for a port. |
Enumerations |
|
v1-portParam¶
Name |
Value |
---|---|
Type |
|
description |
Object containing a data parameter with units and scale values. |
Name |
Type |
Mandatory |
Description |
---|---|---|---|
|
number |
Yes |
Unformatted return value from the device. |
|
number |
Yes |
If appropriate, a user-friendly formatted value. |
|
Yes |
If appropriate, a user-friendly unit string. |
v1-uint8¶
Name |
Value |
---|---|
Type |
integer |
description |
Unsigned 8-bit integer |
minimum |
0 |
maximum |
255 |
v1-uint32¶
Name |
Value |
---|---|
Type |
integer |
description |
Unsigned 32-bit integer |
minimum |
0 |
maximum |
4294967295 |
v1-units¶
Name |
Value |
---|---|
Type |
string |
description |
Allowed and recognized units for a value. |
Enumerations |
|
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/acronameDevicesState
import requests
import json
response = requests.get('http://127.0.0.1:9005/api/v1/acronameDevicesState')
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:24:24.428Z",
3 "request": {
4 "endpointName": "/api/v1/acronameDevicesState",
5 "parameters": {}
6 },
7 "response": {
8 "timestamp": "2023-09-20T17:24:24.108Z",
9 "sequence": 2563,
10 "brainstemVersion": {
11 "major": 2,
12 "minor": 10,
13 "patch": 0
14 },
15 "acronameDevices": [
16 {
17 "serialNumber": "0x3C43352C",
18 "firmwareVersion": {
19 "major": 2,
20 "minor": 10,
21 "patch": 0
22 },
23 "model": "USBHub3c",
24 "upstreamPort": 0,
25 "upstreamPortSelectionIsAutomatic": true,
26 "ports": [
27 {
28 "index": 0,
29 "physicalName": "Port 0",
30 "speed": "5 Gbps",
31 "roles": [
32 "Upstream",
33 "Downstream"
34 ],
35 "currentDataRole": "Upstream",
36 "enabled": true,
37 "voltage": {
38 "value": 5.207519,
39 "units": "volts",
40 "rawValue": 5207519
41 },
42 "current": {
43 "value": 0.00061,
44 "units": "amperes",
45 "rawValue": 610
46 }
47 },
48 {
49 "index": 1,
50 "physicalName": "Port 1",
51 "speed": "Unknown",
52 "roles": [
53 "Upstream",
54 "Downstream"
55 ],
56 "currentDataRole": "Downstream",
57 "enabled": true,
58 "voltage": {
59 "value": 0.0,
60 "units": "volts",
61 "rawValue": 0
62 },
63 "current": {
64 "value": 0.000305,
65 "units": "amperes",
66 "rawValue": 305
67 }
68 },
69 <additional ports ...>
70 ]
71 }
72 ]
73 }
74}