Style, Analyze

This commit is contained in:
2022-09-04 03:06:09 +02:00
parent 3b2f146679
commit 0fe7335987
17 changed files with 216 additions and 184 deletions
+9 -9
View File
@@ -20,17 +20,17 @@
class Socket
{
private:
char lastPath[513] = "";
char lastHash[2 * MD5LEN + 1] = "";
std::mutex wsLock;
std::string url;
std::function<void(std::string)> toLog;
char lastPath[513] = "";
char lastHash[2 * MD5LEN + 1] = "";
std::mutex wsLock;
std::string url;
std::function<void(std::string)> toLog;
public:
explicit Socket(std::string url,
std::function<void(const std::string)> toLog);
~Socket();
void sendData(data d);
explicit Socket(std::string url,
std::function<void(const std::string)> toLog);
~Socket();
void sendData(data d);
};
#endif
+22 -22
View File
@@ -5,24 +5,24 @@
/* Structures and enums */
typedef struct data {
std::int32_t pause = 0;
float pBrake = 0;
std::int32_t onGrnd = 0;
float totFuelKg = 0;
float truHdg = 0;
double alt = 0;
float gs = 0;
float ias = 0;
float vs = 0;
double lat = 0;
double lon = 0;
float ff[8] = {0, 0, 0, 0, 0, 0, 0, 0};
float maxSpd = 0;
char path[513] = "";
float uptime = 0;
float magHeading = 0;
float payloadKg = 0;
float totalWeightKg = 0;
std::int32_t pause = 0;
float pBrake = 0;
std::int32_t onGrnd = 0;
float totFuelKg = 0;
float truHdg = 0;
double alt = 0;
float gs = 0;
float ias = 0;
float vs = 0;
double lat = 0;
double lon = 0;
float ff[8] = {0, 0, 0, 0, 0, 0, 0, 0};
float maxSpd = 0;
char path[513] = "";
float uptime = 0;
float magHeading = 0;
float payloadKg = 0;
float totalWeightKg = 0;
} data;
typedef enum commands {
@@ -38,16 +38,16 @@ typedef enum commands {
} commands;
typedef struct command_base {
commands type;
commands type;
} command_base;
#pragma pack(push) /* push current alignment to stack */
#pragma pack(1) /* set alignment to 1 byte boundary */
typedef struct command_port {
double latitude;
double longitude;
float trueHeading;
double latitude;
double longitude;
float trueHeading;
} command_port;
#pragma pack(pop) /* restore original alignment from stack */