X-Plane Remote Access Plugin and Client Library
Static Public Attributes | List of all members
xplra::Protocol Class Reference

#include <Protocol.h>

Static Public Attributes

static const uint8_t COMMAND_GET_SINGLE = 0x01
 
static const uint8_t COMMAND_SET_SINGLE = 0x02
 
static const uint8_t COMMAND_GET_MULTI = 0x03
 
static const uint8_t COMMAND_SET_MULTI = 0x04
 
static const uint8_t COMMAND_REGISTER_GET_MULTI = 0x11
 
static const uint8_t COMMAND_UNREGISTER_GET_MULTI = 0x12
 
static const uint8_t COMMAND_EXECUTE_GET_MULTI = 0x13
 
static const uint8_t COMMAND_REGISTER_SET_MULTI = 0x21
 
static const uint8_t COMMAND_UNREGISTER_SET_MULTI = 0x22
 
static const uint8_t COMMAND_EXECUTE_SET_MULTI = 0x23
 
static const uint8_t COMMAND_GET_VERSIONS = 0x31
 
static const uint8_t COMMAND_RELOAD_PLUGINS = 0x32
 
static const uint8_t COMMAND_SAVE_SITUATION = 0x33
 
static const uint8_t COMMAND_SHOW_MESSAGE = 0x41
 
static const uint8_t COMMAND_REGISTER_HOTKEYS = 0x51
 
static const uint8_t COMMAND_QUERY_HOTKEYS = 0x52
 
static const uint8_t COMMAND_UNREGISTER_HOTKEYS = 0x53
 
static const uint8_t TYPE_INT = 0x01
 
static const uint8_t TYPE_FLOAT = 0x02
 
static const uint8_t TYPE_DOUBLE = 0x03
 
static const uint8_t TYPE_FLOAT_ARRAY = 0x11
 
static const uint8_t TYPE_INT_ARRAY = 0x12
 
static const uint8_t TYPE_BYTE_ARRAY = 0x13
 
static const uint8_t RESULT_OK = 0x00
 
static const uint8_t RESULT_INVALID_COMMAND = 0x01
 
static const uint8_t RESULT_UNKNOWN_DATAREF = 0x02
 
static const uint8_t RESULT_INVALID_TYPE = 0x03
 
static const uint8_t RESULT_INVALID_LENGTH = 0x04
 
static const uint8_t RESULT_INVALID_OFFSET = 0x05
 
static const uint8_t RESULT_INVALID_COUNT = 0x06
 
static const uint8_t RESULT_INVALID_ID = 0x07
 
static const uint8_t RESULT_INVALID_DURATION = 0x08
 
static const uint8_t RESULT_OTHER_ERROR = 0xff
 
static const uint16_t HOTKEY_MODIFIER_SHIFT = 0x0100
 
static const uint16_t HOTKEY_MODIFIER_CONTROL = 0x0200
 
static const int MAX_LENGTH = 2048
 
static const size_t MAX_MULTI_COUNT = 1024
 
static constexpr float MAX_MESSAGE_DURATION = 5*60
 
static const size_t MAX_HOTKEY_COUNT = 128
 
static const int version = 30
 

Detailed Description

Constants and helpers for the protocol.

Definition at line 45 of file Protocol.h.

Member Data Documentation

◆ COMMAND_EXECUTE_GET_MULTI

const uint8_t xplra::Protocol::COMMAND_EXECUTE_GET_MULTI = 0x13
static

Command: execute a registered multiple-data query request

Definition at line 81 of file Protocol.h.

◆ COMMAND_EXECUTE_SET_MULTI

const uint8_t xplra::Protocol::COMMAND_EXECUTE_SET_MULTI = 0x23
static

Command: execute a registered multiple-data update request

Definition at line 96 of file Protocol.h.

◆ COMMAND_GET_MULTI

const uint8_t xplra::Protocol::COMMAND_GET_MULTI = 0x03
static

Command: get the value of a multiple datarefs.

Definition at line 61 of file Protocol.h.

◆ COMMAND_GET_SINGLE

const uint8_t xplra::Protocol::COMMAND_GET_SINGLE = 0x01
static

Command: get the value of a single dataref.

Definition at line 51 of file Protocol.h.

◆ COMMAND_GET_VERSIONS

const uint8_t xplra::Protocol::COMMAND_GET_VERSIONS = 0x31
static

Command: get the versions of the simulator

Definition at line 101 of file Protocol.h.

◆ COMMAND_QUERY_HOTKEYS

const uint8_t xplra::Protocol::COMMAND_QUERY_HOTKEYS = 0x52
static

Command: query the hotkeys.

The reply consists of a result code, followed by the following data, if the result code is RESULT_OK:

  • The number of hotkeys defined (U32).
  • An array of U8 values each being 0 or 1 depending on whether the corresponding hotkey has been pressed since the last query (or the registration, whichever is later). The value at index i corresponds to the hotkey code at index i in the array passed with COMMAND_REGISTER_HOTKEYS.

If not hotkey has been registered, the number of hotkeys is returned as 0.

Definition at line 153 of file Protocol.h.

◆ COMMAND_REGISTER_GET_MULTI

const uint8_t xplra::Protocol::COMMAND_REGISTER_GET_MULTI = 0x11
static

Command: register a multiple-data query request

Definition at line 71 of file Protocol.h.

◆ COMMAND_REGISTER_HOTKEYS

const uint8_t xplra::Protocol::COMMAND_REGISTER_HOTKEYS = 0x51
static

Command: register a set of hotkeys for the client. Old hotkeys, if any, are forgotten.

The command is followed by the following data:

  • The number of the hotkeys defined (U32).
  • The code of the hotkeys (U16*number of the hotkeys). The lower byte is the same as the X-Plane virtual key code (the same as the ASCII code for numbers and upper-case letters), the upper one is a logical OR of the HOTKEY_MODIFIER_XXX codes.

The reply consists of a result code only. It may fail with an invalid length code if the number of hotkeys is too large.

Definition at line 136 of file Protocol.h.

◆ COMMAND_REGISTER_SET_MULTI

const uint8_t xplra::Protocol::COMMAND_REGISTER_SET_MULTI = 0x21
static

Command: register a multiple-data update request

Definition at line 86 of file Protocol.h.

◆ COMMAND_RELOAD_PLUGINS

const uint8_t xplra::Protocol::COMMAND_RELOAD_PLUGINS = 0x32
static

Command: reload the plugins

Definition at line 106 of file Protocol.h.

◆ COMMAND_SAVE_SITUATION

const uint8_t xplra::Protocol::COMMAND_SAVE_SITUATION = 0x33
static

Command: save the current situation.

Followed by a string containing the path of the file to save relative to the X-System directory.

Definition at line 114 of file Protocol.h.

◆ COMMAND_SET_MULTI

const uint8_t xplra::Protocol::COMMAND_SET_MULTI = 0x04
static

Command: set the value of a multiple datarefs.

Definition at line 66 of file Protocol.h.

◆ COMMAND_SET_SINGLE

const uint8_t xplra::Protocol::COMMAND_SET_SINGLE = 0x02
static

Command: set the value of a single dataref.

Definition at line 56 of file Protocol.h.

◆ COMMAND_SHOW_MESSAGE

const uint8_t xplra::Protocol::COMMAND_SHOW_MESSAGE = 0x41
static

Command: show a message in the message window.

Definition at line 119 of file Protocol.h.

◆ COMMAND_UNREGISTER_GET_MULTI

const uint8_t xplra::Protocol::COMMAND_UNREGISTER_GET_MULTI = 0x12
static

Command: unregister a multiple-data query request

Definition at line 76 of file Protocol.h.

◆ COMMAND_UNREGISTER_HOTKEYS

const uint8_t xplra::Protocol::COMMAND_UNREGISTER_HOTKEYS = 0x53
static

Command: unregister the previously registered hotkeys.

The reply is a result code.

Definition at line 160 of file Protocol.h.

◆ COMMAND_UNREGISTER_SET_MULTI

const uint8_t xplra::Protocol::COMMAND_UNREGISTER_SET_MULTI = 0x22
static

Command: unregister a multiple-data update request

Definition at line 91 of file Protocol.h.

◆ HOTKEY_MODIFIER_CONTROL

const uint16_t xplra::Protocol::HOTKEY_MODIFIER_CONTROL = 0x0200
static

Hotkey modifier: control

Definition at line 250 of file Protocol.h.

◆ HOTKEY_MODIFIER_SHIFT

const uint16_t xplra::Protocol::HOTKEY_MODIFIER_SHIFT = 0x0100
static

Hotkey modifier: shift

Definition at line 245 of file Protocol.h.

◆ MAX_HOTKEY_COUNT

const size_t xplra::Protocol::MAX_HOTKEY_COUNT = 128
static

The maximal number of hotkeys that can be registered for a client.

Definition at line 272 of file Protocol.h.

◆ MAX_LENGTH

const int xplra::Protocol::MAX_LENGTH = 2048
static

The maximal length we accept (in order to protect ourselves).

Definition at line 255 of file Protocol.h.

◆ MAX_MESSAGE_DURATION

constexpr float xplra::Protocol::MAX_MESSAGE_DURATION = 5*60
staticconstexpr

The maximal message duration

Definition at line 266 of file Protocol.h.

◆ MAX_MULTI_COUNT

const size_t xplra::Protocol::MAX_MULTI_COUNT = 1024
static

The maximal count of requests in a multiple-data query or update.

Definition at line 261 of file Protocol.h.

◆ RESULT_INVALID_COMMAND

const uint8_t xplra::Protocol::RESULT_INVALID_COMMAND = 0x01
static

Result code: invalid command

Definition at line 200 of file Protocol.h.

◆ RESULT_INVALID_COUNT

const uint8_t xplra::Protocol::RESULT_INVALID_COUNT = 0x06
static

Result code: invalid count

Definition at line 225 of file Protocol.h.

◆ RESULT_INVALID_DURATION

const uint8_t xplra::Protocol::RESULT_INVALID_DURATION = 0x08
static

Result code: invalid duration

Definition at line 235 of file Protocol.h.

◆ RESULT_INVALID_ID

const uint8_t xplra::Protocol::RESULT_INVALID_ID = 0x07
static

Result code: invalid ID

Definition at line 230 of file Protocol.h.

◆ RESULT_INVALID_LENGTH

const uint8_t xplra::Protocol::RESULT_INVALID_LENGTH = 0x04
static

Result code: invalid length

Definition at line 215 of file Protocol.h.

◆ RESULT_INVALID_OFFSET

const uint8_t xplra::Protocol::RESULT_INVALID_OFFSET = 0x05
static

Result code: invalid offset

Definition at line 220 of file Protocol.h.

◆ RESULT_INVALID_TYPE

const uint8_t xplra::Protocol::RESULT_INVALID_TYPE = 0x03
static

Result code: invalid type

Definition at line 210 of file Protocol.h.

◆ RESULT_OK

const uint8_t xplra::Protocol::RESULT_OK = 0x00
static

Result code: no error, everything is OK.

Definition at line 195 of file Protocol.h.

◆ RESULT_OTHER_ERROR

const uint8_t xplra::Protocol::RESULT_OTHER_ERROR = 0xff
static

Result code: other error

Definition at line 240 of file Protocol.h.

◆ RESULT_UNKNOWN_DATAREF

const uint8_t xplra::Protocol::RESULT_UNKNOWN_DATAREF = 0x02
static

Result code: unknown dataref

Definition at line 205 of file Protocol.h.

◆ TYPE_BYTE_ARRAY

const uint8_t xplra::Protocol::TYPE_BYTE_ARRAY = 0x13
static

Data type: byte array

Definition at line 190 of file Protocol.h.

◆ TYPE_DOUBLE

const uint8_t xplra::Protocol::TYPE_DOUBLE = 0x03
static

Data type: double

Definition at line 175 of file Protocol.h.

◆ TYPE_FLOAT

const uint8_t xplra::Protocol::TYPE_FLOAT = 0x02
static

Data type: float

Definition at line 170 of file Protocol.h.

◆ TYPE_FLOAT_ARRAY

const uint8_t xplra::Protocol::TYPE_FLOAT_ARRAY = 0x11
static

Data type: float array

Definition at line 180 of file Protocol.h.

◆ TYPE_INT

const uint8_t xplra::Protocol::TYPE_INT = 0x01
static

Data type: int

Definition at line 165 of file Protocol.h.

◆ TYPE_INT_ARRAY

const uint8_t xplra::Protocol::TYPE_INT_ARRAY = 0x12
static

Data type: int array

Definition at line 185 of file Protocol.h.

◆ version

const int xplra::Protocol::version = 30
static

The version of the plugin.

Definition at line 277 of file Protocol.h.


The documentation for this class was generated from the following file: