diff --git a/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp b/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp index 3fe0742bf..19a22c9d1 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; @@ -237,6 +239,25 @@ void TestProgramComputer::program(ProgramEnvironment& env, CancellableScope& sco using namespace Pokemon; // using namespace NintendoSwitch::PokemonSwSh::MaxLairInternal; + 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