[client] Start working on hooking the message receiving code up to the PixelMessage class, but there are problems :-(
This commit is contained in:
parent
e0bc536891
commit
461396d231
3 changed files with 12 additions and 4 deletions
|
@ -136,8 +136,16 @@ bool PixelBot::Tick()
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
String nextLine = tcpClient.readStringUntil('\n');
|
||||
Serial.print(" > "); Serial.println(nextLine);
|
||||
char* messageBuffer = new char[nextLine.length()];
|
||||
nextLine.toCharArray(messageBuffer, nextLine.length());
|
||||
|
||||
int MessageType = *(static_cast<unsigned short*>(static_cast<void*>(messageBuffer + 2)));
|
||||
|
||||
Serial.print("Got message: Length: "); Serial.print(nextLine.length());
|
||||
Serial.print(", Message Type: "); Serial.println(MessageType);
|
||||
Serial.print(" > "); Serial.println(messageBuffer);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Reference in a new issue