77
77
/* * SerialMuxProt Server with fixed template argument. */
78
78
typedef SerialMuxProtServer<MAX_CHANNELS> SMPServer;
79
79
80
+ /* * RemoteControl application constants */
81
+ namespace RemoteControl
82
+ {
83
+ /* * Remote control commands. */
84
+ typedef enum : uint8_t
85
+ {
86
+ CMD_ID_IDLE = 0 , /* *< Nothing to do. */
87
+ CMD_ID_START_LINE_SENSOR_CALIB, /* *< Start line sensor calibration. */
88
+ CMD_ID_START_MOTOR_SPEED_CALIB, /* *< Start motor speed calibration. */
89
+ CMD_ID_REINIT_BOARD, /* *< Re-initialize the board. Required for webots simulation. */
90
+ CMD_ID_GET_MAX_SPEED, /* *< Get maximum speed. */
91
+ CMD_ID_START_DRIVING, /* *< Start driving. */
92
+ CMD_ID_SET_INIT_POS, /* *< Set initial position. */
93
+
94
+ } CmdId;
95
+
96
+ /* * Remote control command responses. */
97
+ typedef enum : uint8_t
98
+ {
99
+ RSP_ID_OK = 0 , /* *< Command successful executed. */
100
+ RSP_ID_PENDING, /* *< Command is pending. */
101
+ RSP_ID_ERROR /* *< Command failed. */
102
+
103
+ } RspId;
104
+ } /* namespace RemoteControl */
105
+
80
106
/* * Struct of the "Command" channel payload. */
81
107
typedef struct _Command
82
108
{
83
- uint8_t commandId ; /**< Command ID */
109
+ RemoteControl::CmdId commandId; /* *< Command ID */
84
110
85
111
/* * Command payload. */
86
112
union
@@ -99,8 +125,8 @@ typedef struct _Command
99
125
/* * Struct of the "Command Response" channel payload. */
100
126
typedef struct _CommandResponse
101
127
{
102
- uint8_t commandId ; /**< Command ID */
103
- uint8_t responseId ; /**< Response to the command */
128
+ RemoteControl::CmdId commandId; /* *< Command ID */
129
+ RemoteControl::RspId responseId; /* *< Response to the command */
104
130
105
131
/* * Response Payload. */
106
132
union
0 commit comments