R2D2 API Description

From Ultiroam User Docs
Jump to navigation Jump to search

The R2D2 API is built on top the R2D2 API Daemon using TCP/IP socket interface.

Access to the API can be through different means:

  • R2D2 API BASH Interface Module,
  • R2D2 API C/C++ Interface Module,
  • Telnet or SSH access,
  • Direct TCP/IP interface,
  • And via HTTP/HTTPS Interface see R2D2 HTTP API Interface description.

The gsmrobot.h file enumerating the function prototypes can be given on request.

R2D2 API Daemon is listening on TCP port 1176. The TCP port can be changed in the R2D2 API Daemon configuration.

The R2D2 API Script Language Interface Module connects to the R2D2 API Daemon on this port.

Connection to this TCP port can be accepted only from local host IP address, so R2D2 BASH Script (or any other) Interface Module can run only on the same host as R2D2 API Daemon.

Every R2D2 API Protocol message has a header and additional binary data body.

The message header has the following format:

MESSAGE HEADER
Field Name Length Description
SequenceNumber 4 This field contains a sequence number.

The use of sequence numbers for message correlation allows R2D2 API messages to be exchanged asynchronously.

BodyLength 4 Length (in bytes) of the additional data in message body.

Length does not include the length of the message Header.

MessageCode 4 The MessageCode identifies particular R2D2 API message.

The format of Message Header can be coded as the following C-language structure:

typedef struct {
    ULONG SequenceNumber;
    ULONG BodyLength;
    ULONG MessageCode;
} GRAP_MESSAGE_HEADER;