Skip to content

DeviceManagerRESTAPI

Rob Dobson edited this page Feb 19, 2026 · 31 revisions

DeviceManager REST API

The API for DeviceManager is included in the Raft API List

1. /devman/typeinfo

Description:

This endpoint is used to retrieve detailed information about a specific device type on a given bus. It returns information such as the device's capabilities, status, and configuration details.

GET Parameter Type Required Description
type string Yes The type name of the device to retrieve information for.

Example Request:

/devman/typeinfo?type=LSM6DS

Example Success Response:

{
    "req": "/devman/typeinfo?type=LSM6DS",
    "devinfo": {
        "name": "LSM6DS",
        "desc": "6-Axis IMU",
        "manu": "ST",
        "type": "LSM6DS",
        "resp": {
            "b": 12,
            "a": [
                {
                    "n": "gx",
                    "t": "<h",
                    "u": "dps",
                    "r": [
                        -2000,
                        2000
                    ],
                    "d": 16.384,
                    "f": ".2f",
                    "o": "float"
                },
                {
                    "n": "gy",
                    "t": "<h",
                    "u": "dps",
                    "r": [
                        -2000,
                        2000
                    ],
                    "d": 16.384,
                    "f": ".2f",
                    "o": "float"
                },
                {
                    "n": "gz",
                    "t": "<h",
                    "u": "dps",
                    "r": [
                        -2000,
                        2000
                    ],
                    "d": 16.384,
                    "f": ".2f",
                    "o": "float"
                },
                {
                    "n": "ax",
                    "t": "<h",
                    "u": "g",
                    "r": [
                        -4,
                        4
                    ],
                    "d": 8192,
                    "f": ".2f",
                    "o": "float"
                },
                {
                    "n": "ay",
                    "t": "<h",
                    "u": "g",
                    "r": [
                        -4,
                        4
                    ],
                    "d": 8192,
                    "f": ".2f",
                    "o": "float"
                },
                {
                    "n": "az",
                    "t": "<h",
                    "u": "g",
                    "r": [
                        -4,
                        4
                    ],
                    "d": 8192,
                    "f": ".2f",
                    "o": "float"
                }
            ]
        }
    },
    "rslt": "ok"
}

Example Failure Response

{
  "req": "/devman/typeinfo?type=UnknownDevice",
  "rslt": "error",
  "error": "failTypeNotFound"
}

Other failure reasons:

  • failTypeMissing: Missing type parameter.
  • failTypeNotFound: The specified type was not found.

2. /devman/cmdraw

Description:
This endpoint allows raw commands to be sent to a device on a specified bus. It can be used to send low-level control commands to devices, such as writing specific data to a device register.

Method: GET

URL Parameters:

Parameter Type Required Description
bus string Yes The name of the bus where the device is located.
addr string Yes The address of the device on the bus.
hexWr string No A hex-encoded string representing the data to write to the device.
numToRd int No The number of bytes to read from the device.

Example Request:

/devman/cmdraw?bus=I2C1&addr=0x3C&hexWr=F00D

Example Response:

{
    "req":"/devman/cmdraw?bus=I2CA&addr=0x6a",
    "rslt":"ok"
}

Response Fields:

  • result: Indicates the success or failure of the command (ok, error).

Error Responses:

  • failBusMissing: Missing bus parameter.
  • failMissingAddr: Missing addr parameter.
  • failBusNotFound: The specified bus was not found.

3. /devman/cmdjson

Description:
Routes a JSON command to a specific device. The JSON body must include a device field that matches the configured device name or device ID string.

Method: GET

URL Parameters:

Parameter Type Required Description
body string Yes JSON command string; must include a device field.

Example Request:

/devman/cmdjson?body={"device":"I2CA_20","cmd":"reset"}

Error Responses:

  • failMissingBody: Missing body parameter.
  • failDeviceNotFound: The specified device was not found.
  • failNoDeviceSpecified: The JSON body did not include a device field.
  • failCmdFailed: The command failed in the device handler.

4. /devman/busname

Description:
This endpoint retrieves the bus name from a bus number. Bus numbers start from 1 and match the numbering used in device data JSON/binary messages. Only buses with valid device interfaces are numbered.

Method: GET

URL Parameters:

Parameter Type Required Description
busnum int Yes The bus number to retrieve the name for.

Example Request:

/devman/busname?busnum=1

Example Success Response:

{
    "req": "devman/busname?busnum=1",
    "rslt": "ok",
    "busName": "I2CA"
}

Error Responses:

  • failInvalidBusNum: Missing or invalid busnum parameter.
  • failBusNotFound: The specified bus number was not found.

5. /devman/setpollinterval

Description:
This endpoint sets the polling interval for a bus-connected device. Only works for devices connected via a bus (I2C, Serial, etc.).

Method: GET

URL Parameters:

Parameter Type Required Description
bus string or int Yes The bus name (e.g., "I2CA") or bus number.
device string Yes The device ID or device address (e.g. "20" or "I2CA_20").
intervalMs int Yes The polling interval in milliseconds.

Example Request:

/devman/setpollinterval?bus=I2CA&device=20&intervalMs=50

or

/devman/setpollinterval?device=1_20&intervalMs=50

Example Success Response:

{
    "req": "devman/setpollinterval?bus=I2CA&device=20&intervalMs=50",
    "rslt": "ok"
}

Error Responses:

  • failBusMissing: Missing bus parameter.
  • failDeviceMissing: Missing device parameter.
  • failInvalidInterval: Missing or invalid intervalMs parameter.
  • failDeviceNotFound: The specified device was not found.
  • failBusNotFound: The specified bus was not found.

6. /devman/demo

Description:
Starts a demo device instance (if enabled) with a configurable sample rate, duration, and offline behavior. Useful for testing pipelines without real hardware.

Method: GET

URL Parameters:

Parameter Type Required Description
type string No Device type name; default ACCDEMO.
rate int No Sample rate in ms (min 10, max 60000).
duration int No Duration in ms (0 for continuous).
offlineIntvS int No Offline interval seconds.
offlineDurS int No Offline duration seconds (min 1).

Example Request:

/devman/demo?type=ACCDEMO&rate=100&duration=10000

Error Responses:

  • failDemoDeviceExists: The demo device already exists.

Clone this wiki locally