From c24d94c20c2199c74a5d9f462cfd58bbbfb25b33 Mon Sep 17 00:00:00 2001
From: "ucart@co3050-12" <dawehr@iastate.edu>
Date: Sun, 29 Jan 2017 16:24:54 -0600
Subject: [PATCH] added the datatype parameter back into MessageType struct in
 commands.h because Jake actually does need it.

---
 groundStation/src/backend/commands.c | 20 ++++++++++++++++++++
 groundStation/src/backend/commands.h | 12 ++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/groundStation/src/backend/commands.c b/groundStation/src/backend/commands.c
index 1c451d39b..1cef27dc9 100644
--- a/groundStation/src/backend/commands.c
+++ b/groundStation/src/backend/commands.c
@@ -75,6 +75,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"debug",
+		// Type of the command data
+		stringType,
 		// Function pointer
 		&cb_debug
 	},
@@ -82,6 +84,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"packetlog",
+		// Type of the command data
+		stringType,
 		// Function pointer
 		&cb_packetlog
 	},
@@ -89,6 +93,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"getpacketlogs",
+		// Type of the command data
+		stringType,
 		// Function pointer
 		&cb_getpacketlogs
 	},
@@ -96,6 +102,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"update",
+		// Type of the command data
+		stringType,
 		// Function pointer
 		&cb_update
 	},
@@ -103,6 +111,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"beginupdate",
+		// Type of the command data
+		stringType,
 		// Function pointer
 		&cb_beginupdate
 	},
@@ -110,6 +120,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"log",
+		// Type of the command data
+		stringType,
 		// Function pointer
 		&cb_log
 	},
@@ -117,6 +129,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"response",
+		// Type of the command data
+		stringType,
 		// Function pointer
 		&cb_response
 	},
@@ -124,6 +138,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"setcontrol",
+		// Type of the command data
+		floatType,
 		// Function pointer
 		&cb_setcontrol
 	},
@@ -131,6 +147,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"getcontrol",
+		// Type of the command data
+		floatType,
 		// Function pointer
 		&cb_getcontrol
 	},
@@ -138,6 +156,8 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
 	{
 		// Command text
 		"respcontrol",
+		// Type of the command data
+		floatType,
 		// Function pointer
 		&cb_respcontrol
 	}
diff --git a/groundStation/src/backend/commands.h b/groundStation/src/backend/commands.h
index a3ef5d752..9fda24a71 100644
--- a/groundStation/src/backend/commands.h
+++ b/groundStation/src/backend/commands.h
@@ -14,6 +14,17 @@ 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
@@ -64,6 +75,7 @@ enum ControllerValueID{
  */
 struct MessageType{
 	char cmdText[MAX_CMD_TEXT_LENGTH];
+	char cmdDataType;
 	command_cb * functionPtr;
 };
 
-- 
GitLab