|
RSeries astromech firmware
|
|
Go to the documentation of this file. 1 #ifndef JawaCommander_h
2 #define JawaCommander_h
19 const char* str = inputStr;
20 if ((ch = *str++) ==
'\0')
26 addr = addr * 10 + (ch -
'0');
28 }
while (isdigit(ch));
48 arg = arg * 10 + (ch -
'0');
50 }
while (isdigit(ch));
68 while ((ch = *str++) !=
'\0' && bm < bme)
82 else if (ch >=
'A' && ch <=
'Z')
94 value = value * 10 + (ch -
'0');
96 }
while (isdigit(ch));
104 char *fne = fname +
sizeof(fname) - 1;
105 if ((ch = *str) ==
'0')
111 while ((ch = *str++) !=
'\0' && fn < fne)
143 if (ch !=
'\n' && ch !=
'\r')
151 if (ch ==
'\n' || ch ==
'\r')
183 for (
char ch; (ch = *msg) !=
'\0'; msg++)
235 template<u
int8_t BUFFER_SIZE=20, u
int8_t MSG_SIZE=20>
249 char fBufferStorage[BUFFER_SIZE];
250 char fMessageBufferStorage[MSG_SIZE];
char * getBuffer()
Return a direct pointer to the parsers input buffer.
Definition: JawaCommander.h:191
char * fMessageBuffer
Definition: JawaCommander.h:224
size_t getMessageSize()
Return the maximum size of the input buffer.
Definition: JawaCommander.h:207
static JawaCommanderBase ** base()
Definition: JawaCommander.h:213
uint8_t fMsgSize
Definition: JawaCommander.h:222
bool parseCommand(const char *inputStr)
Parse the specified command string.
Definition: JawaCommander.h:15
static JawaCommanderBase * get()
Definition: JawaCommander.h:173
void process(const char *msg)
Append a string of character to the parsers input buffer.
Definition: JawaCommander.h:181
JAWA Lite command parser.
Definition: JawaCommander.h:236
char * fBuffer
Definition: JawaCommander.h:223
Definition: JawaCommander.h:6
static void process(int addr, char cmd, int arg=0, int value=0)
Definition: JawaEvent.h:48
uint8_t fBufferSize
Definition: JawaCommander.h:221
JawaCommanderBase()
Definition: JawaCommander.h:9
bool fNewLine
Definition: JawaCommander.h:219
size_t getBufferSize()
Return the maximum size of the input buffer.
Definition: JawaCommander.h:199
char * fPtr
Definition: JawaCommander.h:225
JawaCommander()
Definition: JawaCommander.h:239
void process(const char ch)
Append a single character to the parsers input buffer.
Definition: JawaCommander.h:139
bool fSkipEOL
Definition: JawaCommander.h:220