Commit 6533948c authored by Pavel Vainerman's avatar Pavel Vainerman

minor fixes in MBSlave..

parent 2ad55d55
......@@ -105,12 +105,14 @@ prefix(prefix)
int port = conf->getArgPInt("--" + prefix + "-inet-port",it.getProp("iport"), 502);
dlog[Debug::INFO] << myname << "(init): type=TCP myaddr=" << ModbusRTU::addr2str(addr)
<< " inet=" << iaddr << " port=" << port << endl;
ost::InetAddress ia(iaddr.c_str());
mbslot = new ModbusTCPServerSlot(ia,port);
thr = new ThreadCreator<MBSlave>(this,&MBSlave::execute_tcp);
dlog[Debug::INFO] << myname << "(init): type=TCP myaddr=" << ModbusRTU::addr2str(addr)
<< " inet=" << iaddr << " port=" << port << endl;
dlog[Debug::INFO] << myname << "(init): init TCP connection ok. " << " inet=" << iaddr << " port=" << port << endl;
}
else
throw UniSetTypes::SystemError(myname+"(MBSlave): Unknown slave type. Use: --mbs-type [RTU|TCP]");
......@@ -124,7 +126,7 @@ prefix(prefix)
mbslot->connectWriteOutput( sigc::mem_fun(this, &MBSlave::writeOutputRegisters) );
mbslot->connectWriteSingleOutput( sigc::mem_fun(this, &MBSlave::writeOutputSingleRegister) );
if( findArgParam("--mbs-allow-setdatetime",conf->getArgc(),conf->getArgv())!=-1 )
if( findArgParam("--" + prefix + "-allow-setdatetime",conf->getArgc(),conf->getArgv())!=-1 )
mbslot->connectSetDateTime( sigc::mem_fun(this, &MBSlave::setDateTime) );
mbslot->connectFileTransfer( sigc::mem_fun(this, &MBSlave::fileTransfer) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment