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

removed the "data_type" struct from commands.h.

- removed the "ID", datatype parameters from MessateType struct in commands.h
- made equivalent changes in commands.c
parent 19fedcae
No related branches found
No related tags found
No related merge requests found
......@@ -73,111 +73,71 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
{
// DEBUG
{
// ID
DEBUG_ID,
// Command text
"debug",
// Type of the command data
stringType,
// Function pointer
&cb_debug
},
// PACKETLOG
{
// ID
PACKETLOG_ID,
// Command text
"packetlog",
// Type of the command data
stringType,
// Function pointer
&cb_packetlog
},
// GETPACKETLOGS
{
// ID
GETPACKETLOGS_ID,
// Command text
"getpacketlogs",
// Type of the command data
stringType,
// Function pointer
&cb_getpacketlogs
},
// UPDATE
{
// ID
UPDATE_ID,
// Command text
"update",
// Type of the command data
stringType,
// Function pointer
&cb_update
},
// BEGINUPDATE
{
// ID
BEGINUPDATE_ID,
// Command text
"beginupdate",
// Type of the command data
stringType,
// Function pointer
&cb_beginupdate
},
// LOG
{
// ID
LOG_ID,
// Command text
"log",
// Type of the command data
stringType,
// Function pointer
&cb_log
},
// RESPONSE
{
// ID
RESPONSE_ID,
// Command text
"response",
// Type of the command data
stringType,
// Function pointer
&cb_response
},
// SETCONTROL
{
// ID
SETCONTROL_ID,
// Command text
"setcontrol",
// Type of the command data
floatType,
// Function pointer
&cb_setcontrol
},
// GETCONTROL
{
// ID
GETCONTROL_ID,
// Command text
"getcontrol",
// Type of the command data
floatType,
// Function pointer
&cb_getcontrol
},
// RESPCONTROL
{
// ID
RESPCONTROL_ID,
// Command text
"respcontrol",
// Type of the command data
floatType,
// Function pointer
&cb_respcontrol
}
......
......@@ -14,17 +14,6 @@ enum Message{
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
* Enumeration used to index the MessageTypes array in commands.c
......@@ -74,16 +63,7 @@ enum ControllerValueID{
* pointers located in commands.c
*/
struct MessageType{
/* TODO The ID may not even be needed since it already an enumerated value
* I found some instances of this being used like the following:
* "MessageTypes[LOG_TYPE_ID].ID" which makes no sense since the ID member
* in the MessageType is already set to be equal to the enumeration value
* instead they could have just done "LOG_TYPE_ID" directly since
* MessageTypes[LOG_TYPE_ID].ID always == LOG_TYPE_ID
*/
char ID;
char cmdText[MAX_CMD_TEXT_LENGTH];
char cmdDataType;
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