Webserver

XiBIF includes a simple webserver that can be used to read and write registers via HTTP requests. The Webserver is by default enabled and listens on port 80. It can be disabled by running

xibif settings --hw.enable_webserver False

API

The webserver exposes a simple REST API that can be used to read and write registers.

GET /register/map

Returns the complete register map as JSON. This endpoint provides information about all available registers in the system.

Example Request

curl http://<device-ip>/register/map

Response (JSON)

JSON object containing the register map definition.

POST /register/read

Reads a value from a specific register address with configurable bit range.

Request Body (JSON)

  • address (number): Register address to read from

  • lsb (number): Least significant bit position (0-31)

  • width (number): Number of bits to read (1-32)

Example Request

curl -X POST http://<device-ip>/register/read \
  -H "Content-Type: application/json" \
  -d '{"address": 0, "lsb": 0, "width": 32}'

Response (JSON)

{
  "address": 0,
  "lsb": 0,
  "width": 32,
  "value": 12345
}

POST /register/write

Writes a value to a specific register address with configurable bit range. Only the specified bits are modified (read-modify-write operation).

Request Body (JSON)

  • address (number): Register address to write to

  • lsb (number): Least significant bit position (0-31)

  • width (number): Number of bits to write (1-32)

  • value (number): Value to write (will be masked to width)

Example Request

curl -X POST http://<device-ip>/register/write \
  -H "Content-Type: application/json" \
  -d '{"address": 0, "lsb": 0, "width": 32, "value": 12345}'

Response (JSON)

{
  "address": 0,
  "lsb": 0,
  "width": 32,
  "value": 12345
}

Note

Both decimal and hexadecimal (with 0x prefix) values are supported in JSON requests.