v1.3.0.0
WASimCommander.h File Reference
#include <chrono>
#include <cstdint>
#include <iomanip>
#include <ostream>
#include "global.h"
#include "wasim_version.h"
#include "enums.h"

Go to the source code of this file.

Classes

struct  WASimCommander::Command
 Command data structure. The member contents depend on the command type as described in each command type of the Enums::CommandId enum documentation. More...
 
struct  WASimCommander::DataRequest
 Structure for variable value subscription requests. More...
 
struct  WASimCommander::KeyEvent
 Data structure for sending Key Events to the sim with up to 5 event values. Events are specified using numeric MSFS Event IDs (names can be resolved to IDs via Lookup command). This supports the new functionality in MSFS SU10 with trigger_key_event_EX1() Gauge API function (similar to SimConnect_TransmitClientEvent_EX1()). The server will respond with an Ack/Nak for a SendKey command, echoing the given token. For events with zero or one value, the SendKey command can be used instead. More...
 
struct  WASimCommander::LogRecord
 Log record structure. More...
 

Namespaces

namespace  WASimCommander
 WASimCommander main namespace. Defines constants and structs used in Client-Server interactions. Many of these are needed for effective use of WASimClient, and all would be useful for custom client implementations.
 

Macros

#define WSMCMND_COMMON_NAME_PREFIX   WSMCMND_PROJECT_NAME "."
 common prefix for all event and data area names More...
 
#define WSMCMND_EVENT_NAME_CONNECT   "Connect"
 Initial connection event for all clients: "WASimCommander.Connect". More...
 
#define WSMCMND_EVENT_NAME_PING   "Ping"
 Ping event for all clients ("WASimCommander.Ping") and prefix for response event ("WASimCommander.Ping.<client_name>") More...
 
#define WSMCMND_CDA_NAME_COMMAND   "Command"
 Data area name prefix for Command data sent to Server: "WASimCommander.Command.<client_name>". More...
 
#define WSMCMND_CDA_NAME_RESPONSE   "Response"
 Data area name prefix for Command data sent to Client: "WASimCommander.Response.<client_name>". More...
 
#define WSMCMND_CDA_NAME_DATA   "Data"
 Data area name prefix for DataRequest data sent to Server ("WASimCommander.Data.<client_name>") and data value updates sent to Client: "WASimCommander.Data.<client_name>.<request_id>". More...
 
#define WSMCMND_CDA_NAME_KEYEVENT   "KeyEvent"
 Data area name prefix for KeyEvent data sent to Client: "WASimCommander.KeyEvent.<client_name>". More...
 
#define WSMCMND_CDA_NAME_LOG   "Log"
 Data area name prefix for LogRecord data sent to Client: "WASimCommander.Log.<client_name>". More...
 
#define WSE   WASimCommander::Enums
 

Variables

Char array string size limits, including null terminator.
static const size_t WASimCommander::STRSZ_CMD = 527
 Maximum size of Command::sData member. Size optimizes alignment of Command struct. More...
 
static const size_t WASimCommander::STRSZ_REQ = 1030
 Maximum size for request calculator string or variable name. Size optimizes alignment of DataRequest struct. More...
 
static const size_t WASimCommander::STRSZ_UNIT = 37
 Maximum Unit name size. Size is of longest known unit name + 1. More...
 
static const size_t WASimCommander::STRSZ_LOG = 1031
 Size of log entry message in LogRecord::message. Size optimizes alignment of LogRecord struct. More...
 
static const size_t WASimCommander::STRSZ_ENAME = 64
 Maximum size of custom event name in Enums::CommandId::Register command. More...
 
Time periods
static const time_t WASimCommander::TICK_PERIOD_MS = 25
 Minimum update period for data Requests in milliseconds. Also dictates rate of some other client-specific processing on server (WASM module) side. 25ms = 40Hz. More...
 
static const time_t WASimCommander::CONN_TIMEOUT_SEC = 60 * 10
 Number of seconds after which a non-responsive client is considered disconnected. Client must respond to heartbeat pings from the server if not otherwise transmitting anything within this timeout period. More...
 
Predefined value types

Using these constants for the DataRequest::valueSize property will allow delta epsilon comparisons.

static const uint32_t WASimCommander::DATA_TYPE_INT8 = -1
 8-bit integer number (signed or unsigned) More...
 
static const uint32_t WASimCommander::DATA_TYPE_INT16 = -2
 16-bit integer number (signed or unsigned) More...
 
static const uint32_t WASimCommander::DATA_TYPE_INT32 = -3
 32-bit integer number (signed or unsigned) More...
 
static const uint32_t WASimCommander::DATA_TYPE_INT64 = -4
 64-bit integer number (signed or unsigned) More...
 
static const uint32_t WASimCommander::DATA_TYPE_FLOAT = -5
 32-bit floating-point number More...
 
static const uint32_t WASimCommander::DATA_TYPE_DOUBLE = -6
 64-bit floating-point number More...
 

Macro Definition Documentation

◆ WSMCMND_COMMON_NAME_PREFIX

#define WSMCMND_COMMON_NAME_PREFIX   WSMCMND_PROJECT_NAME "."

common prefix for all event and data area names

Definition at line 37 of file WASimCommander.h.

◆ WSMCMND_EVENT_NAME_CONNECT

#define WSMCMND_EVENT_NAME_CONNECT   "Connect"

Initial connection event for all clients: "WASimCommander.Connect".

Definition at line 38 of file WASimCommander.h.

◆ WSMCMND_EVENT_NAME_PING

#define WSMCMND_EVENT_NAME_PING   "Ping"

Ping event for all clients ("WASimCommander.Ping") and prefix for response event ("WASimCommander.Ping.<client_name>")

Definition at line 39 of file WASimCommander.h.

◆ WSMCMND_CDA_NAME_COMMAND

#define WSMCMND_CDA_NAME_COMMAND   "Command"

Data area name prefix for Command data sent to Server: "WASimCommander.Command.<client_name>".

Definition at line 40 of file WASimCommander.h.

◆ WSMCMND_CDA_NAME_RESPONSE

#define WSMCMND_CDA_NAME_RESPONSE   "Response"

Data area name prefix for Command data sent to Client: "WASimCommander.Response.<client_name>".

Definition at line 41 of file WASimCommander.h.

◆ WSMCMND_CDA_NAME_DATA

#define WSMCMND_CDA_NAME_DATA   "Data"

Data area name prefix for DataRequest data sent to Server ("WASimCommander.Data.<client_name>") and data value updates sent to Client: "WASimCommander.Data.<client_name>.<request_id>".

Definition at line 42 of file WASimCommander.h.

◆ WSMCMND_CDA_NAME_KEYEVENT

#define WSMCMND_CDA_NAME_KEYEVENT   "KeyEvent"

Data area name prefix for KeyEvent data sent to Client: "WASimCommander.KeyEvent.<client_name>".

Since
v1.1.0

Definition at line 43 of file WASimCommander.h.

◆ WSMCMND_CDA_NAME_LOG

#define WSMCMND_CDA_NAME_LOG   "Log"

Data area name prefix for LogRecord data sent to Client: "WASimCommander.Log.<client_name>".

Definition at line 44 of file WASimCommander.h.

◆ WSE

#define WSE   WASimCommander::Enums

Definition at line 90 of file WASimCommander.h.