Rework driver code, again.
This commit is contained in:
@@ -108,7 +108,7 @@ BCValueTypeByte::BCValueTypeByte( QString unitLabel_, double factor_, optDouble
|
||||
|
||||
QString BCValueTypeByte::createStringValue( const BCAbstractTransmitter& transmitter, uint32_t deviceID, uint8_t registerID ) const
|
||||
{
|
||||
uint32_t result = transmitter.readRawByte( deviceID, registerID );
|
||||
uint8_t result = transmitter.readByte( deviceID, registerID );
|
||||
return formatValue( result );
|
||||
}
|
||||
|
||||
@@ -124,9 +124,9 @@ QString BCValueTypeWord::createStringValue( const BCAbstractTransmitter& transmi
|
||||
{
|
||||
//getValue(CONSOLE, CONSOLE_SN_PN_HI) << 8) + getValue(CONSOLE, CONSOLE_SN_PN_LO)),
|
||||
// hi byte
|
||||
uint32_t result = transmitter.readRawByte( deviceID, registerID ) << 8;
|
||||
uint8_t result = transmitter.readByte( deviceID, registerID ) << 8;
|
||||
// low byte, use followup register: +1
|
||||
result += transmitter.readRawByte( deviceID, registerID+1 );
|
||||
result += transmitter.readByte( deviceID, registerID+1 );
|
||||
|
||||
return formatValue( result );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user