Downlink — get the LoRaWAN class of a device
Returns the LoRaWAN class of a device: A, B or C. The class determines when the server can deliver a downlink: to a class A device only right after its next uplink, to a class C device at any time. Request the class before sending data to know how long delivery may take.
Request and response: dev_lw_class_req → get_devices_resp.
Access: a low access level token sees the devices of its application and of applications that granted it access; a high access level token sees all devices of the owner.
The server responds with get_devices_resp, not dev_lw_class_resp as stated in the v0.17 description. You can tell this response from the response to get_devices_req by the lwClass field and your operation_id.
The server returns at most one device per request, so always specify devEui.
Request
Fields not marked as required may be omitted.
| Field | Type | Description |
|---|---|---|
cmd | string | dev_lw_class_req |
operation_id | string | Any string; the server returns it in the response to match the request and the response |
devEui | string | Device DevEUI, 16 hex characters. Without it the server returns one of the available devices — see "Current ONS version" |
{
"cmd": "dev_lw_class_req",
"operation_id": "axd",
"devEui": "6F1E570FFE14DBFC"
}
Response
| Field | Type | Description |
|---|---|---|
cmd | string | get_devices_resp |
operation_id | string | Value from the request |
status | uint8 | 1 — success, 2 — error |
deviceCount | uint32 | Number of devices in the list: 0 or 1 |
deviceList | array | Devices: devEui, devAddr and lwClass — LoRaWAN class (1 — A, 2 — B, 3 — C) |
error_code, error_text | uint8, string | Only on error, see below |
{
"cmd": "get_devices_resp",
"operation_id": "axd",
"status": 1,
"deviceCount": 1,
"deviceList": [
{
"devEui": "6F1E570FFE14DBFC",
"devAddr": "78130AE1",
"lwClass": 1
}
]
}
Errors
error_code | What happened |
|---|---|
| 3 | Invalid data in the request, e.g. devEui is not 16 hex characters |
| 0 | Internal server error — retry later |
A device that does not exist or is not available with your token is not treated as an error: it is simply absent from deviceList.
See also
- Sending data to a device — how downlink works and in which order to call the commands.
- Device classes — how classes A, B and C differ.