Consts and references

This commit is contained in:
2022-09-09 20:10:38 +02:00
parent b050c23577
commit 699e2a4784
16 changed files with 156 additions and 179 deletions
+12 -21
View File
@@ -3,12 +3,14 @@
#include <cstdint>
#pragma pack(push) /* push current alignment to stack */
#pragma pack(1) /* set alignment to 1 byte boundary */
namespace germanairlinesva_websocket
{
#pragma pack(push) /* push current alignment to stack */
#pragma pack(1) /* set alignment to 1 byte boundary */
/* Structures and enums */
typedef struct data {
struct data {
std::int32_t pause = 0;
float pBrake = 0;
std::int32_t onGrnd = 0;
@@ -27,30 +29,19 @@ namespace germanairlinesva_websocket
float magHeading = 0;
float payloadKg = 0;
float totalWeightKg = 0;
} data;
};
typedef enum commands {
PROCESS,
SAVE,
LOAD,
TEXT,
TIME,
UNPAUSE,
PAUSE,
PORT,
END
} commands;
enum commands { PROCESS, SAVE, LOAD, TEXT, TIME, UNPAUSE, PAUSE, PORT, END };
typedef struct command_base {
commands type;
} command_base;
struct command_base {
enum commands type;
};
typedef struct command_port {
struct command_port {
double latitude;
double longitude;
float trueHeading;
} command_port;
};
#pragma pack(pop) /* restore original alignment from stack */
} // namespace germanairlinesva_websocket