Skip to content
Snippets Groups Projects
Commit fe49e94b authored by dawehr's avatar dawehr
Browse files

added the datatype parameter back into MessageType struct in commands.h...

added the datatype parameter back into MessageType struct in commands.h because Jake actually does need it.
parent c175e0c2
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -75,6 +75,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"debug", "debug",
// Type of the command data
stringType,
// Function pointer // Function pointer
&cb_debug &cb_debug
}, },
...@@ -82,6 +84,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -82,6 +84,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"packetlog", "packetlog",
// Type of the command data
stringType,
// Function pointer // Function pointer
&cb_packetlog &cb_packetlog
}, },
...@@ -89,6 +93,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -89,6 +93,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"getpacketlogs", "getpacketlogs",
// Type of the command data
stringType,
// Function pointer // Function pointer
&cb_getpacketlogs &cb_getpacketlogs
}, },
...@@ -96,6 +102,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -96,6 +102,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"update", "update",
// Type of the command data
stringType,
// Function pointer // Function pointer
&cb_update &cb_update
}, },
...@@ -103,6 +111,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -103,6 +111,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"beginupdate", "beginupdate",
// Type of the command data
stringType,
// Function pointer // Function pointer
&cb_beginupdate &cb_beginupdate
}, },
...@@ -110,6 +120,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -110,6 +120,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"log", "log",
// Type of the command data
stringType,
// Function pointer // Function pointer
&cb_log &cb_log
}, },
...@@ -117,6 +129,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -117,6 +129,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"response", "response",
// Type of the command data
stringType,
// Function pointer // Function pointer
&cb_response &cb_response
}, },
...@@ -124,6 +138,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -124,6 +138,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"setcontrol", "setcontrol",
// Type of the command data
floatType,
// Function pointer // Function pointer
&cb_setcontrol &cb_setcontrol
}, },
...@@ -131,6 +147,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -131,6 +147,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"getcontrol", "getcontrol",
// Type of the command data
floatType,
// Function pointer // Function pointer
&cb_getcontrol &cb_getcontrol
}, },
...@@ -138,6 +156,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -138,6 +156,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{ {
// Command text // Command text
"respcontrol", "respcontrol",
// Type of the command data
floatType,
// Function pointer // Function pointer
&cb_respcontrol &cb_respcontrol
} }
......
...@@ -14,6 +14,17 @@ enum Message{ ...@@ -14,6 +14,17 @@ enum Message{
END_CHAR = 0xED END_CHAR = 0xED
}; };
/*
* Enumeration of the data types that a callback function may use
* doubleType should get added here at some point
*/
enum DataType
{
floatType, // 00
intType, // 01
stringType // 02
};
/* /*
* Message type IDs used to know what kind of message we are dealing with * Message type IDs used to know what kind of message we are dealing with
* Enumeration used to index the MessageTypes array in commands.c * Enumeration used to index the MessageTypes array in commands.c
...@@ -64,6 +75,7 @@ enum ControllerValueID{ ...@@ -64,6 +75,7 @@ enum ControllerValueID{
*/ */
struct MessageType{ struct MessageType{
char cmdText[MAX_CMD_TEXT_LENGTH]; char cmdText[MAX_CMD_TEXT_LENGTH];
char cmdDataType;
command_cb * functionPtr; command_cb * functionPtr;
}; };
......
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