273 const std::string& prefix =
"mbtcp" );
277 static std::shared_ptr<MBTCPMultiMaster>
init_mbmaster(
int argc,
const char*
const* argv,
279 const std::string& prefix =
"mbtcp" );
281 static void help_print(
int argc,
const char*
const* argv );
287 virtual void initIterators()
override;
288 virtual std::shared_ptr<ModbusClient> initMB(
bool reopen =
false )
override;
290 virtual bool reconfigure(
const std::shared_ptr<uniset::UniXML>& xml,
const std::shared_ptr<uniset::MBConfig>& mbconf )
override;
291 void initCheckConnectionParameters();
299 bool force_disconnect;
301 timeout_t defaultIgnoreTimeout;
302 timeout_t channelTimeout;
309 MBSlaveInfo(): ip(
""), port(0), mbtcp(0), priority(0),
311 recv_timeout(200), aftersend_pause(0), sleepPause_usec(100),
312 force_disconnect(
true),
313 myname(
""), use(
false), initOK(
false), ignore(
false) {}
317 std::shared_ptr<ModbusTCPMaster> mbtcp;
321 ModbusRTU::SlaveFunctionCode checkFunc = { ModbusRTU::fnUnknown };
322 ModbusRTU::ModbusAddr checkAddr = { 0x00 };
323 ModbusRTU::ModbusData checkReg = { 0 };
327 IOController::IOStateList::iterator respond_it;
329 bool respond_init = {
false };
330 bool respond_force = {
false };
332 timeout_t channel_timeout = { 0 };
334 inline bool operator < (
const MBSlaveInfo& mbs )
const noexcept
336 return priority < mbs.priority;
339 bool init( std::shared_ptr<DebugStream>& mblog );
341 void setUse(
bool st );
343 timeout_t recv_timeout;
344 timeout_t aftersend_pause;
345 timeout_t sleepPause_usec;
346 bool force_disconnect;
350 bool use = {
false };
351 bool initOK = {
false };
352 bool ignore = {
false };
355 const std::string getShortInfo()
const;
360 typedef std::list<std::shared_ptr<MBSlaveInfo>> MBGateList;
363 MBGateList::reverse_iterator mbi;
367 std::unique_ptr< ThreadCreator<MBTCPMultiMaster> > pollThread;
368 std::unique_ptr< ThreadCreator<MBTCPMultiMaster> > checkThread;
static std::shared_ptr< MBTCPMultiMaster > init_mbmaster(int argc, const char *const *argv, uniset::ObjectId shmID, const std::shared_ptr< SharedMemory > &ic=nullptr, const std::string &prefix="mbtcp")
Definition MBTCPMultiMaster.cc:698