From ffa26836e9a5379cefa21c81afa52cfded92d47d Mon Sep 17 00:00:00 2001 From: ackimixs Date: Tue, 16 Apr 2024 19:53:52 +0200 Subject: [PATCH] send back the message --- TCPServer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index 4701164..c4e92ff 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -244,6 +244,8 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) else if (tokens[0] == "arduino" && tokens[2] == "set state") { if (TCPUtils::startWith(tokens[3], "0")) { this->isRobotMoving++; + std::string temp = message; + this->broadcastMessage(temp, clientSocket); } } std::cout << "Received: " << message << std::endl; @@ -453,7 +455,6 @@ void TCPServer::startGame() { usleep(500'000); // ReSharper disable once CppDFAUnreachableCode - usleep(500'000); this->broadcastMessage("strat;servo_moteur;baisser bras;1\n"); @@ -531,6 +532,8 @@ void TCPServer::startGame() { pinceState[1] = NONE; usleep(1'000'000); + this->broadcastMessage("strat;arduino;speed;150\n"); + toSend = "strat;arduino;go;" + std::to_string(static_cast(this->endRobotPose.pos.x)) + "," + std::to_string(static_cast(this->endRobotPose.pos.y)) + "\n"; this->broadcastMessage(toSend); isRobotMoving = 0;