|
|
@ -121,24 +121,24 @@ bool PixelBot::Connect() |
|
|
|
void PixelBot::Listen() |
|
|
|
{ |
|
|
|
while(true) { |
|
|
|
Serial.println("[PixelBot/Server] Entering main loop."); |
|
|
|
|
|
|
|
// Make sure that there's something to read
|
|
|
|
if(tcpClient.available() == 0) { |
|
|
|
delay(10); // sleep for 10ms
|
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
String nextLine = tcpClient.readStringUntil('\n'); |
|
|
|
Serial.print(" > "); Serial.println(nextLine); |
|
|
|
|
|
|
|
|
|
|
|
if(!Tick()) |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
bool PixelBot::processCommand(String command) |
|
|
|
bool PixelBot::Tick() |
|
|
|
{ |
|
|
|
Serial.println("[PixelBot/Server] Entering main loop."); |
|
|
|
|
|
|
|
return false; |
|
|
|
// Make sure that there's something to read
|
|
|
|
if(tcpClient.available() == 0) { |
|
|
|
delay(10); // sleep for 10ms
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
String nextLine = tcpClient.readStringUntil('\n'); |
|
|
|
Serial.print(" > "); Serial.println(nextLine); |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|