/************************************************************************/ /* */ /* SerialCommand.c -- Allows interface - computer <-> AVR */ /* */ /************************************************************************/ /* Author: Chris Keeser */ /* Revision History: */ /* created: (ChrisK) 7/23/05 */ /************************************************************************/ #include "SerialCommand.h" #define CCOMMANDS 2 char szBuf[256]; char * arszCommands[CCOMMANDS] = {"Command 1" , "Command 2"}; // when this function is called, there is a string waiting // in the message buffer that needs to be executed void ExecuteCommand(char * szMessage) { DWORD i; if(strcmp(szMessage,"Command 1") == 0) { tx_string("Command 1 has been executed"); ResetCommand(); } else if(strcmp(szMessage,"Command 2") == 0) { tx_string("Command 2 has been executed"); ResetCommand(); } else { tx_string("Command Error"); tx_string("Valid commands are:"); for(i = 0 ; i < CCOMMANDS; i++) { tx_string(arszCommands[i]); } ResetCommand(); } return; }