From fe9ab160939d333df79c868eb3bf42eccc5304a3 Mon Sep 17 00:00:00 2001 From: IMback Date: Fri, 5 Oct 2018 21:09:11 +0200 Subject: [PATCH] serial io ajustments --- main.cpp | 11 +++++------ serial_io.cpp | 39 +++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/main.cpp b/main.cpp index dada414..dc0e7c5 100644 --- a/main.cpp +++ b/main.cpp @@ -58,9 +58,8 @@ std::cout<<"Rates:\n\ B2000000 0010013\n"; } -class Config +struct Config { -public: std::string portFileName = "/dev/ttyUSB0"; unsigned short port = 6856; int baud = 0000017; @@ -113,7 +112,7 @@ void acceptThreadFunction( TCPServerSocket* servSock, std::vector* if(newSock != nullptr) { clientSockets->push_back(newSock); // Wait for a client to connect - clientSockets->back()->send("UVOS serial port multiplexer v0.1\n", sizeof("uvos serial port multiplexer v0.1\n")-1); + clientSockets->back()->send("UVOS serial multiplexer v0.2\n", sizeof("UVOS serial multiplexer v0.2\n")-1); std::cout<<"got client\n"; } std::this_thread::sleep_for(std::chrono::milliseconds(20)); @@ -176,11 +175,11 @@ int main(int argc, char* argv[]) std::cout<<"rec: "; for( int j = 0; j < reclen; j++ )std::cout<send(inBuffer+5, reclen-5); + for( int j = 6; j < reclen; j++ )std::cout<send(inBuffer+6, reclen-6); std::cout<