diff --git a/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp b/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp index 38768dc56..6389c1570 100644 --- a/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp +++ b/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp @@ -147,6 +147,8 @@ //#include +#include +#include #include using std::cout; @@ -264,6 +266,26 @@ void TestProgramComputer::program(ProgramEnvironment& env, CancellableScope& sco cout << detector.detect(image) << endl; #endif + QTcpSocket socket; + socket.connectToHost("127.0.0.1", 18069); + socket.waitForConnected(); + + while (true) { + QDataStream outData(&socket); + outData << std::int32_t{ 42 }; + + socket.waitForReadyRead(); + QDataStream inData(socket.readAll()); + std::int32_t inValue; + inData >> inValue; + + std::stringstream ss; + ss << "Received : " << inValue; + env.logger().log(ss.str()); + + std::this_thread::sleep_for(std::chrono::seconds(10)); + } + #if 0 ImageRGB32 image("20231120-221849973351.png");