Skip to content
Snippets Groups Projects
Commit 745a91cd authored by Jake's avatar Jake
Browse files

Implemented FindCommand

parent ee97f3e0
No related branches found
No related tags found
No related merge requests found
...@@ -183,3 +183,14 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -183,3 +183,14 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
} }
}; };
int findCommand(char * str)
{
for (int i = 0; i < MAX_TYPE_ID; i++) {
if (strcmp(str, MessageTypes[i].cmdText) == 0) {
return i;
}
}
return -1;
}
...@@ -89,10 +89,6 @@ struct MessageType{ ...@@ -89,10 +89,6 @@ struct MessageType{
/* Defined in commands.c */ /* Defined in commands.c */
extern struct MessageType MessageTypes[MAX_TYPE_ID]; extern struct MessageType MessageTypes[MAX_TYPE_ID];
int findCommand(char * cmdStr);
/* Legacy functions - no idea what uses these. Please do not delete. */
float getFloat(unsigned char* str, int pos);
int getInt(unsigned char* str, int pos);
/* end legacy crap */
#endif #endif
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