Commit fff7e4bc authored by Pavel Vainerman's avatar Pavel Vainerman

..мелкие правки..

parent 4b86c607
...@@ -33,7 +33,7 @@ RTUStorage::~RTUStorage() ...@@ -33,7 +33,7 @@ RTUStorage::~RTUStorage()
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void RTUStorage::poll( const std::shared_ptr<ModbusRTUMaster> mb ) throw( ModbusRTU::mbException ) void RTUStorage::poll( const std::shared_ptr<ModbusRTUMaster>& mb ) throw( ModbusRTU::mbException )
{ {
try try
{ {
......
...@@ -16,7 +16,7 @@ class RTUStorage ...@@ -16,7 +16,7 @@ class RTUStorage
RTUStorage( ModbusRTU::ModbusAddr addr ); RTUStorage( ModbusRTU::ModbusAddr addr );
~RTUStorage(); ~RTUStorage();
void poll( const std::shared_ptr<ModbusRTUMaster> mb ) void poll( const std::shared_ptr<ModbusRTUMaster>& mb )
throw(ModbusRTU::mbException); throw(ModbusRTU::mbException);
inline ModbusRTU::ModbusAddr getAddress(){ return addr; } inline ModbusRTU::ModbusAddr getAddress(){ return addr; }
......
...@@ -369,14 +369,14 @@ const DataBits& DataBits::operator=( const ModbusByte& r ) ...@@ -369,14 +369,14 @@ const DataBits& DataBits::operator=( const ModbusByte& r )
{ {
for( unsigned int i=0; i<b.size(); i++ ) for( unsigned int i=0; i<b.size(); i++ )
b[i] = r&(1<<i); b[i] = r&(1<<i);
return (*this); return (*this);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::ostream& ModbusRTU::operator<<(std::ostream& os, DataBits& d ) std::ostream& ModbusRTU::operator<<(std::ostream& os, DataBits& d )
{ {
os << "["; os << "[";
for( unsigned int i=d.b.size()-1; i>=0; i-- ) for( unsigned int i=d.b.size()-1; i!=0; i-- )
os << d.b[i]; os << d.b[i];
os << "]"; os << "]";
...@@ -432,7 +432,7 @@ const DataBits16& DataBits16::operator=( const ModbusData& r ) ...@@ -432,7 +432,7 @@ const DataBits16& DataBits16::operator=( const ModbusData& r )
std::ostream& ModbusRTU::operator<<(std::ostream& os, DataBits16& d ) std::ostream& ModbusRTU::operator<<(std::ostream& os, DataBits16& d )
{ {
os << "["; os << "[";
for( unsigned int i=d.b.size()-1; i>=0; i-- ) for( unsigned int i=d.b.size()-1; i!=0; i-- )
os << d.b[i]; os << d.b[i];
os << "]"; os << "]";
......
...@@ -2257,7 +2257,7 @@ ModbusMessage DiagnosticMessage::transport_msg() ...@@ -2257,7 +2257,7 @@ ModbusMessage DiagnosticMessage::transport_msg()
ModbusData crc = checkCRC( (ModbusByte*)(&mm), szModbusHeader+sizeof(subf)+sizeof(ModbusData)*count ); ModbusData crc = checkCRC( (ModbusByte*)(&mm), szModbusHeader+sizeof(subf)+sizeof(ModbusData)*count );
// копируем CRC (последний элемент). Без переворачивания... // копируем CRC (последний элемент). Без переворачивания...
memcpy(&(mm.data[ind]),&crc,szCRC); memcpy(&(mm.data[ind]),&crc,szCRC);
ind+=szCRC; ind+=szCRC;
// длина сообщения... // длина сообщения...
......
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