Andruav Communication Protocol

Andruav Communication Protocol is the protocol that is used to communicate between units and server, and between units modules.

Andruav Communication Message Protocol

Protocol is a text JSON message header. Payload can be text or binary, but header is always JSON text. The protocol is very flexible and can be even carry embedded mavlink messages or any other message protocol as a payload.

Important:

Communication Protocol between Communicator and other unit module is called de-dev-databus

Protocol Header Fields

sender

This is the sender unique-id called party-id. It uniquely identifies the unit in the system.

target

This is the party-id of the receiver. If the message should be received by group of receivers then target can be:

  1. AGN’: all units in the system. i.e. units under the same account and group.

  2. GCS’: all GCS in the system. i.e. units under the same account and group.

  3. GD’: all GCS & units.

There is also a special sender/target called ‘SYS’, and this is the messages that is created or handled by Andruav-Communicator-Server.

if target is not existed then this is a global message. It is up to server-communicator logic how to handle this.

see: js_andruav_chat_server.js function fn_parseMessage

message type

field: mt

This is a numeric field that defines the message itself.

see: de-dev-andruav-communication-protocol-messages

Protocol Payload Fields

message command

field: ms

This field holds the text payload of the message. It is a JSON string with fields based one message_type. The fields ends with null and then starts binary payload of the message if exists.

see: js_andruav_chat_server.js function fn_parseMessage

binary command

Binary command is optional based on the message type. The binary data is concatenated after the text content of the message header. A binary message can contain also message command in text format. Binary content length is defined by subtracting total message length from the text content that is terminated by a null character.