Skip to content
Snippets Groups Projects
Commit c386bffc authored by burneykb's avatar burneykb
Browse files

added commands to commands.h/c

parent abb2a21c
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,17 @@ command_cb cb_setparam __attribute__((weak, alias("cb_default")));
command_cb cb_getparam __attribute__((weak, alias("cb_default")));
command_cb cb_respparam __attribute__((weak, alias("cb_default")));
command_cb cb_setsource __attribute__((weak, alias("cb_default")));
command_cb cb_getsource __attribute__((weak, alias("cb_default")));
command_cb cb_respsource __attribute__((weak, alias("cb_default")));
command_cb cb_getoutput __attribute__((weak, alias("cb_default")));
command_cb cb_respoutput __attribute__((weak, alias("cb_default")));
command_cb cb_getnodes __attribute__((weak, alias("cb_default")));
command_cb cb_respnodes __attribute__((weak, alias("cb_default")));
/*
* Command structure.
* This array is used to keep track of the callback functions
......@@ -165,6 +176,69 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
// Function pointer
&cb_respparam
},
// SETSOURCE
{
// Command text
"setsource",
// Type of the command data
floatType,
// Function pointer
&cb_setsource
},
// GETSOURCE
{
// Command text
"getsource",
// Type of the command data
floatType,
// Function pointer
&cb_getsource
},
// RESPSOURCE
{
// Command text
"respsource",
// Type of the command data
floatType,
// Function pointer
&cb_respsource
},
// GETOUTPUT
{
// Command text
"getoutput",
// Type of the command data
floatType,
// Function pointer
&cb_respoutput
},
// RESPOUTPUT
{
// Command text
"respoutput",
// Type of the command data
floatType,
// Function pointer
&cb_respoutput
},
// GETNODES
{
// Command text
"getnodes",
// Type of the command data
floatType,
// Function pointer
&cb_getnodes
},
// RESPNODES
{
// Command text
"respnodes",
// Type of the command data
floatType,
// Function pointer
&cb_respnodes
},
// LOG_END
{
// Command text
......
......@@ -45,39 +45,16 @@ enum MessageTypeID{
SETPARAM_ID, // 07 - Setting controller parameters. Example: PID constants
GETPARAM_ID, // 08 - Getting controller parameters. Example: PID constants
RESPPARAM_ID, // 09 - Responding with controller parameters. Example: PID constants
LOG_END_ID, // 10 - Responding with controller parameters. Example: PID constants
MAX_TYPE_ID // 11 - Just used to keep track of the size. Must remain at the end
SETSOURCE_ID, // 10 - Setting controller source Block & id
GETSOURCE_ID, // 11 - Getting controller source Block & id
RESPSOURCE_ID, // 12 - Responding with controller source Block & id
GETOUTPUT_ID, // 13 - Getting controller block output
RESPOUTPUT_ID, // 14 - Responding with controller block output
GETNODES_ID, // 15 - Getting nodes from current comp_graph
RESPNODES_ID, // 16 - Responding with nodes from current comp_graph
LOG_END_ID, // 17 - Responding with controller parameters. Example: PID constants
MAX_TYPE_ID // 18 - Just used to keep track of the size. Must remain at the end
};
/*
* Controller ID used to know which controller the message is referencing
*/
enum ControllerID{
ROLL_ID, // 00 - Roll PID
PITCH_ID, // 01 - Pitch PID
YAW_ID, // 02 - Yaw PID
ROLL_RATE_ID, // 03 - Roll rate PID
PITCH_RATE_ID, // 04 - Pitch rate PID
YAW_RATE_ID, // 05 - Yaw rate PID
LOCAL_X_ID, // 06 - Local X PID // lat
LOCAL_Y_ID, // 07 - Local Y PID //long
ALT_ID, // 08 - Altitude PID
X_SETPOINT_ID, // 09 - X Setpoint //lat
Y_SETPOINT_ID, // 10 - Y Setpoint //long
ALT_SETPOINT_ID, // 11 - Z Setpoint
MAX_CONTROLLER_ID // 12 - Just used to keep track of the size
};
/*
* Enumeration of controller parameters
*/
enum ControlParamID{
KP_ID, // 00 - P constant
KI_ID, // 01 - I constant
KD_ID, // 02 - D constant
MAX_CONTROL_PARAM_ID, // 03 - Just used to keep track of the size
};
/*
* Message type struct used to keep track of the callback function
* pointers located in commands.c
......
......@@ -14,7 +14,7 @@ enum ResponseData {
RESP_DATA_SIZE
};
/* Creates data and metadata for a respcontrol packet
/* Creates data and metadata for a respparam packet
* Returns data size.
*/
ssize_t EncodeResponseParam(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment