bcst: now forwarded to clients
This commit is contained in:
15
CMakeLists.txt
Normal file
15
CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
cmake_minimum_required(VERSION 2.4)
|
||||||
|
|
||||||
|
|
||||||
|
project(serialmultiplexer)
|
||||||
|
|
||||||
|
set(SRC_FILES main.cpp serial_io.cpp Socket.cpp )
|
||||||
|
set(LIBS -pthread )
|
||||||
|
|
||||||
|
add_executable(${PROJECT_NAME} ${SRC_FILES})
|
||||||
|
|
||||||
|
target_link_libraries( ${PROJECT_NAME} ${LIBS})
|
||||||
|
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS -m64 LINK_FLAGS -m64)
|
||||||
|
add_definitions(" -std=c++11 -Wall ")
|
||||||
|
|
||||||
|
install(TARGETS serialmultiplexer RUNTIME DESTINATION bin)
|
4
main.cpp
4
main.cpp
@ -229,10 +229,10 @@ int main(int argc, char* argv[])
|
|||||||
if(config.verbose)
|
if(config.verbose)
|
||||||
{
|
{
|
||||||
std::cout<<"bcst: ";
|
std::cout<<"bcst: ";
|
||||||
for( int j = 6; j < reclen; j++ )std::cout<<inBuffer[j];
|
for( int j = 0; j < reclen; j++ )std::cout<<inBuffer[j];
|
||||||
std::cout<<std::endl;
|
std::cout<<std::endl;
|
||||||
}
|
}
|
||||||
for(unsigned int j = 0; j < clientSockets.size(); j++) if(i != j) clientSockets[j]->send(inBuffer+6, reclen-6);
|
for(unsigned int j = 0; j < clientSockets.size(); j++) if(i != j) clientSockets[j]->send(inBuffer, reclen);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(strncmp( inBuffer, "reinitsp", 8) == 0 && serial != -1)
|
else if(strncmp( inBuffer, "reinitsp", 8) == 0 && serial != -1)
|
||||||
|
Reference in New Issue
Block a user