Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion lib/APPConvoyFollower/src/SerialMuxChannels.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
/******************************************************************************
* Includes
*****************************************************************************/

#include <Arduino.h>
#include <SerialMuxProtServer.hpp>

Expand Down Expand Up @@ -159,6 +158,9 @@ typedef struct _Command

} __attribute__((packed)) Command;

static_assert(sizeof(Command) <= MAX_DATA_LEN,
"Command struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Command Response" channel payload. */
typedef struct _CommandResponse
{
Expand All @@ -172,6 +174,9 @@ typedef struct _CommandResponse
};
} __attribute__((packed)) CommandResponse;

static_assert(sizeof(CommandResponse) <= MAX_DATA_LEN,
"CommandResponse struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Speed" channel payload. */
typedef struct _SpeedData
{
Expand All @@ -180,6 +185,9 @@ typedef struct _SpeedData
int32_t center; /**< Center motor speed [mm/s] */
} __attribute__((packed)) SpeedData;

static_assert(sizeof(SpeedData) <= MAX_DATA_LEN,
"SpeedData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Current Vehicle Data" channel payload. */
typedef struct _VehicleData
{
Expand All @@ -192,12 +200,18 @@ typedef struct _VehicleData
SMPChannelPayload::Range proximity; /**< Range at which object is found [range]. */
} __attribute__((packed)) VehicleData;

static_assert(sizeof(VehicleData) <= MAX_DATA_LEN,
"VehicleData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Status" channel payload. */
typedef struct _Status
{
SMPChannelPayload::Status status; /**< Status */
} __attribute__((packed)) Status;

static_assert(sizeof(Status) <= MAX_DATA_LEN,
"Status struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/******************************************************************************
* Functions
*****************************************************************************/
Expand Down
16 changes: 15 additions & 1 deletion lib/APPConvoyLeader/src/SerialMuxChannels.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
/******************************************************************************
* Includes
*****************************************************************************/

#include <Arduino.h>
#include <SerialMuxProtServer.hpp>

Expand Down Expand Up @@ -159,6 +158,9 @@ typedef struct _Command

} __attribute__((packed)) Command;

static_assert(sizeof(Command) <= MAX_DATA_LEN,
"Command struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Command Response" channel payload. */
typedef struct _CommandResponse
{
Expand All @@ -172,6 +174,9 @@ typedef struct _CommandResponse
};
} __attribute__((packed)) CommandResponse;

static_assert(sizeof(CommandResponse) <= MAX_DATA_LEN,
"CommandResponse struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Speed" channel payload. */
typedef struct _SpeedData
{
Expand All @@ -180,6 +185,9 @@ typedef struct _SpeedData
int32_t center; /**< Center motor speed [mm/s] */
} __attribute__((packed)) SpeedData;

static_assert(sizeof(SpeedData) <= MAX_DATA_LEN,
"SpeedData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Current Vehicle Data" channel payload. */
typedef struct _VehicleData
{
Expand All @@ -192,12 +200,18 @@ typedef struct _VehicleData
SMPChannelPayload::Range proximity; /**< Range at which object is found [range]. */
} __attribute__((packed)) VehicleData;

static_assert(sizeof(VehicleData) <= MAX_DATA_LEN,
"VehicleData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Status" channel payload. */
typedef struct _Status
{
SMPChannelPayload::Status status; /**< Status */
} __attribute__((packed)) Status;

static_assert(sizeof(Status) <= MAX_DATA_LEN,
"Status struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/******************************************************************************
* Functions
*****************************************************************************/
Expand Down
22 changes: 21 additions & 1 deletion lib/APPLineFollower/src/SerialMuxChannels.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
/******************************************************************************
* Includes
*****************************************************************************/

#include <Arduino.h>
#include <SerialMuxProtServer.hpp>

Expand Down Expand Up @@ -171,6 +170,9 @@ typedef struct _Command

} __attribute__((packed)) Command;

static_assert(sizeof(Command) <= MAX_DATA_LEN,
"Command struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Command Response" channel payload. */
typedef struct _CommandResponse
{
Expand All @@ -184,20 +186,29 @@ typedef struct _CommandResponse
};
} __attribute__((packed)) CommandResponse;

static_assert(sizeof(CommandResponse) <= MAX_DATA_LEN,
"CommandResponse struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Motor Speed Setpoints" channel payload. */
typedef struct _MotorSpeed
{
int32_t left; /**< Left motor speed [mm/s] */
int32_t right; /**< Right motor speed [mm/s] */
} __attribute__((packed)) MotorSpeed;

static_assert(sizeof(MotorSpeed) <= MAX_DATA_LEN,
"MotorSpeed struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Robot Speed Setpoints" channel payload. */
typedef struct _RobotSpeed
{
int32_t linearCenter; /**< Linear speed of the vehicle center. [mm/s] */
int32_t angular; /**< Angular speed. [mrad/s] */
} __attribute__((packed)) RobotSpeed;

static_assert(sizeof(RobotSpeed) <= MAX_DATA_LEN,
"RobotSpeed struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Current Vehicle Data" channel payload. */
typedef struct _VehicleData
{
Expand All @@ -210,18 +221,27 @@ typedef struct _VehicleData
SMPChannelPayload::Range proximity; /**< Range at which object is found [range]. */
} __attribute__((packed)) VehicleData;

static_assert(sizeof(VehicleData) <= MAX_DATA_LEN,
"VehicleData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Status" channel payload. */
typedef struct _Status
{
SMPChannelPayload::Status status; /**< Status */
} __attribute__((packed)) Status;

static_assert(sizeof(Status) <= MAX_DATA_LEN,
"Status struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Line Sensor" channel payload. */
typedef struct _LineSensorData
{
uint16_t lineSensorData[5U]; /**< Line sensor data [digits] normalized to max 1000 digits. */
} __attribute__((packed)) LineSensorData;

static_assert(sizeof(LineSensorData) <= MAX_DATA_LEN,
"LineSensorData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/******************************************************************************
* Functions
*****************************************************************************/
Expand Down
22 changes: 21 additions & 1 deletion lib/APPRemoteControl/src/SerialMuxChannels.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
/******************************************************************************
* Includes
*****************************************************************************/

#include <Arduino.h>
#include <SerialMuxProtServer.hpp>

Expand Down Expand Up @@ -171,6 +170,9 @@ typedef struct _Command

} __attribute__((packed)) Command;

static_assert(sizeof(Command) <= MAX_DATA_LEN,
"Command struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Command Response" channel payload. */
typedef struct _CommandResponse
{
Expand All @@ -184,20 +186,29 @@ typedef struct _CommandResponse
};
} __attribute__((packed)) CommandResponse;

static_assert(sizeof(CommandResponse) <= MAX_DATA_LEN,
"CommandResponse struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Motor Speed Setpoints" channel payload. */
typedef struct _MotorSpeed
{
int32_t left; /**< Left motor speed [mm/s] */
int32_t right; /**< Right motor speed [mm/s] */
} __attribute__((packed)) MotorSpeed;

static_assert(sizeof(MotorSpeed) <= MAX_DATA_LEN,
"MotorSpeed struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Robot Speed Setpoints" channel payload. */
typedef struct _RobotSpeed
{
int32_t linearCenter; /**< Linear speed of the vehicle center. [mm/s] */
int32_t angular; /**< Angular speed. [mrad/s] */
} __attribute__((packed)) RobotSpeed;

static_assert(sizeof(RobotSpeed) <= MAX_DATA_LEN,
"RobotSpeed struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Current Vehicle Data" channel payload. */
typedef struct _VehicleData
{
Expand All @@ -210,18 +221,27 @@ typedef struct _VehicleData
SMPChannelPayload::Range proximity; /**< Range at which object is found [range]. */
} __attribute__((packed)) VehicleData;

static_assert(sizeof(VehicleData) <= MAX_DATA_LEN,
"VehicleData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Status" channel payload. */
typedef struct _Status
{
SMPChannelPayload::Status status; /**< Status */
} __attribute__((packed)) Status;

static_assert(sizeof(Status) <= MAX_DATA_LEN,
"Status struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Line Sensor" channel payload. */
typedef struct _LineSensorData
{
uint16_t lineSensorData[5U]; /**< Line sensor data [digits] normalized to max 1000 digits. */
} __attribute__((packed)) LineSensorData;

static_assert(sizeof(LineSensorData) <= MAX_DATA_LEN,
"LineSensorData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/******************************************************************************
* Functions
*****************************************************************************/
Expand Down
4 changes: 3 additions & 1 deletion lib/APPSensorFusion/src/SerialMuxChannels.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
/******************************************************************************
* Includes
*****************************************************************************/

#include <stdint.h>
#include <SerialMuxProtServer.hpp>

Expand Down Expand Up @@ -94,6 +93,9 @@ typedef struct _SensorData

} __attribute__((packed)) SensorData;

static_assert(sizeof(SensorData) <= MAX_DATA_LEN,
"SensorData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/******************************************************************************
* Functions
*****************************************************************************/
Expand Down
22 changes: 21 additions & 1 deletion lib/APPTurtle/src/SerialMuxChannels.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
/******************************************************************************
* Includes
*****************************************************************************/

#include <Arduino.h>
#include <SerialMuxProtServer.hpp>

Expand Down Expand Up @@ -171,6 +170,9 @@ typedef struct _Command

} __attribute__((packed)) Command;

static_assert(sizeof(Command) <= MAX_DATA_LEN,
"Command struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Command Response" channel payload. */
typedef struct _CommandResponse
{
Expand All @@ -184,20 +186,29 @@ typedef struct _CommandResponse
};
} __attribute__((packed)) CommandResponse;

static_assert(sizeof(CommandResponse) <= MAX_DATA_LEN,
"CommandResponse struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Motor Speed Setpoints" channel payload. */
typedef struct _MotorSpeed
{
int32_t left; /**< Left motor speed [mm/s] */
int32_t right; /**< Right motor speed [mm/s] */
} __attribute__((packed)) MotorSpeed;

static_assert(sizeof(MotorSpeed) <= MAX_DATA_LEN,
"MotorSpeed struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Robot Speed Setpoints" channel payload. */
typedef struct _RobotSpeed
{
int32_t linearCenter; /**< Linear speed of the vehicle center. [mm/s] */
int32_t angular; /**< Angular speed. [mrad/s] */
} __attribute__((packed)) RobotSpeed;

static_assert(sizeof(RobotSpeed) <= MAX_DATA_LEN,
"RobotSpeed struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Current Vehicle Data" channel payload. */
typedef struct _VehicleData
{
Expand All @@ -210,18 +221,27 @@ typedef struct _VehicleData
SMPChannelPayload::Range proximity; /**< Range at which object is found [range]. */
} __attribute__((packed)) VehicleData;

static_assert(sizeof(VehicleData) <= MAX_DATA_LEN,
"VehicleData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Status" channel payload. */
typedef struct _Status
{
SMPChannelPayload::Status status; /**< Status */
} __attribute__((packed)) Status;

static_assert(sizeof(Status) <= MAX_DATA_LEN,
"Status struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/** Struct of the "Line Sensor" channel payload. */
typedef struct _LineSensorData
{
uint16_t lineSensorData[5U]; /**< Line sensor data [digits] normalized to max 1000 digits. */
} __attribute__((packed)) LineSensorData;

static_assert(sizeof(LineSensorData) <= MAX_DATA_LEN,
"LineSensorData struct size must be less than or equal to MAX_DATA_LEN to fit in the SerialMuxProt frame.");

/******************************************************************************
* Functions
*****************************************************************************/
Expand Down
Loading