|
UniSet
2.6.0
|
00001 // ------------------------------------------------------------------------- 00002 #ifndef ModbusHelpers_H_ 00003 #define ModbusHelpers_H_ 00004 // ------------------------------------------------------------------------- 00005 #include <string> 00006 #include "ModbusTypes.h" 00007 #include "ComPort.h" 00008 // ------------------------------------------------------------------------- 00009 namespace uniset 00010 { 00011 // ------------------------------------------------------------------------- 00012 class ModbusRTUMaster; 00013 // ------------------------------------------------------------------------- 00014 namespace ModbusHelpers 00015 { 00016 ModbusRTU::ModbusAddr autodetectSlave( ModbusRTUMaster* m, 00017 ModbusRTU::ModbusAddr beg = 0, 00018 ModbusRTU::ModbusAddr end = 255, 00019 ModbusRTU::ModbusData reg = 0, 00020 ModbusRTU::SlaveFunctionCode fn = ModbusRTU::fnReadInputRegisters 00021 ); // throw uniset::TimeOut(); 00022 00023 ModbusRTU::ModbusAddr autodetectSlave( std::string dev, 00024 ComPort::Speed s, int tout = 1000, 00025 ModbusRTU::ModbusAddr beg = 0, 00026 ModbusRTU::ModbusAddr end = 255, 00027 ModbusRTU::ModbusData reg = 0, 00028 ModbusRTU::SlaveFunctionCode fn = ModbusRTU::fnReadInputRegisters 00029 ); // throw uniset::TimeOut(); 00030 00031 ComPort::Speed autodetectSpeed( ModbusRTUMaster* m, ModbusRTU::ModbusAddr slave, 00032 ModbusRTU::ModbusData reg = 0, 00033 ModbusRTU::SlaveFunctionCode fn = ModbusRTU::fnReadInputRegisters 00034 ); // throw uniset::TimeOut(); 00035 00036 ComPort::Speed autodetectSpeed( std::string dev, 00037 ModbusRTU::ModbusAddr slave, 00038 int timeout_msec = 1000, 00039 ModbusRTU::ModbusData reg = 0, 00040 ModbusRTU::SlaveFunctionCode fn = ModbusRTU::fnReadInputRegisters 00041 ); // throw uniset::TimeOut(); 00042 00043 } // end of namespace ModbusHelpers 00044 // --------------------------------------------------------------------------- 00045 } // end of namespace uniset 00046 // --------------------------------------------------------------------------- 00047 #endif // ModbusHelpers_H_ 00048 // ---------------------------------------------------------------------------
1.7.6.1