Commit fff7e4bc authored by Pavel Vainerman's avatar Pavel Vainerman

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

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