CBOR-RPC

ANURA transceivers utilize a generic Remote Procedure Call protocol built on top of the CBOR serialization format. This protocol is the exclusive means of interacting with transceivers. Depending on the transceiver model, the protocol is available over TCP or USB transport protocols.

Message Types

The protocol defines three message types:

  • Request: Used for initiating procedure calls.

  • Response: Used to reply to procedure calls.

  • Notification: Used for unsolicited notifications from the server to the client.

Request and Response messages are used for procedure calls. The client sends a Request containing a request token, a method identifier, and an argument. The server (i.e., the transceiver) sends a Response back with the same message token, containing either an error or a result.

Notification messages are used for unsolicited notifications and do not require a request token. They are identified solely by a method name.

Roles

  • Server: Receives requests and sends back responses. Can send notifications.

  • Client: Sends requests and receives responses. Can receive notifications.

Message Format

All messages are encoded and sent as a CBOR array where the first element identifies the type of message. Methods and errors starting with .well-known are reserved for the protocol itself and should not be used otherwise.

Request Message

Request Message Fields

Field

Type

Description

Message Type

uint (0)

Contains the value 0 to denote a Request message.

Request Token

uint

Unique identifier for the request; used to match responses.

Method

str / uint

Identifies the method to be called.

Argument

any

A single CBOR value (typically a list or a dict, or null) passed as an argument to the method.

Response Message

Response Message Fields

Field

Type

Description

Type

uint (1)

Contains the value 1 to denote a Response message.

Request Token

uint

Matches the Request Token from the corresponding request.

Error

null / any

Contains error information if the call failed; otherwise, null.

Result

any

Result of the method call if successful.

Notification Message

Notification Message Fields

Field

Type

Description

Type

uint (2)

Contains the value 2 to denote a Notification message.

Method

str / uint

Identifies the method associated with the notification.

Data

any

A single CBOR value containing additional information related to the notification.

Method Not Found Error

If a method is not found, the server responds with:

[1, <Request Token>, ".well-known.not-found", null]

This is a special case to indicate that the method does not exist.

Well-Known Methods

method .well-known/methods

Discover all available methods and their numeric identifiers.

This method returns a mapping of all available methods to their numeric identifiers. Clients may use these numeric identifiers in subsequent requests for efficiency.

The available methods may vary depending on the transceiver firmware version.

Note

The numeric identifiers returned by this method are not API stable. Clients should refresh this result upon every connection.

Parameters:

None

Returns:

CBOR map mapping method names (strings) to numeric identifiers (integers)