|
|
@ -38,13 +38,13 @@ EventHandlerResult FocusSerial::afterEachCycle() {
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
command_[i++] = Runtime.serialPort().read();
|
|
|
|
command_[i++] = Runtime.serialPort().read();
|
|
|
|
} while (command_[i - 1] != SEPARATOR
|
|
|
|
} while (command_[i - 1] != SEPARATOR
|
|
|
|
&& i < sizeof(command_)
|
|
|
|
&& i < sizeof(command_)
|
|
|
|
&& Runtime.serialPort().available()
|
|
|
|
&& Runtime.serialPort().available()
|
|
|
|
&& (Runtime.serialPort().peek() != NEWLINE ));
|
|
|
|
&& (Runtime.serialPort().peek() != NEWLINE));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If this was a command with a space-delimited payload, strip the space delimiter off
|
|
|
|
// If this was a command with a space-delimited payload, strip the space delimiter off
|
|
|
|
if (command_[i - 1] == SEPARATOR )
|
|
|
|
if (command_[i - 1] == SEPARATOR)
|
|
|
|
command_[i - 1] = '\0';
|
|
|
|
command_[i - 1] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|