Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
handler.h
00001 00002 #ifndef HANDLER_H 00003 #define HANDLER_H 00004 #include "mbed.h" 00005 00006 #define MATCHSIZE 128 00007 #define STARTCHAR 'S' 00008 #define ENDCHAR 'E' 00009 #define ONECHR '1' 00010 #define ZEROCHR '0' 00011 #define HOSTERROR "HOST ERROR\r\n" 00012 00013 //#define DEBUGHAND 00014 00015 class Handler { 00016 00017 public: 00018 Handler(char* nm); 00019 void run(); 00020 bool isReady(); 00021 char *getMatchString(); 00022 void init(); 00023 00024 private: 00025 char *name; 00026 char matchString[MATCHSIZE]; 00027 char completeMatchString[MATCHSIZE]; 00028 char *pmatchString; 00029 enum SerialStates { WAITINGON_S, RECIEVING_MATCH}; 00030 SerialStates state; 00031 enum StringStates { READY, NOTREADY}; 00032 StringStates stringState; 00033 int value; 00034 void resetMatch(); 00035 void recieveMatchString(char c); 00036 void waitForStart(char c); 00037 void matchStringRecieved(); 00038 void hostError(); 00039 void processChar(char c); 00040 void recievedStart(char c); 00041 }; 00042 #endif
Generated on Wed Jul 13 2022 17:38:20 by
1.7.2