Reworked value reading.
This commit is contained in:
@@ -17,7 +17,8 @@ void BCTransmitter::onToggleConnectionState( bool connect )
|
||||
if( _canDriver.getState() != BCCanDriver::DriverState::Ready )
|
||||
_canDriver.onStartDriver();
|
||||
|
||||
uint32_t hwVersion = _canDriver.readRawValue( BCDevice::ID::Console, BC::ID::Cons_Rev_Hw);
|
||||
// fix!
|
||||
uint32_t hwVersion = _canDriver.readRawByte( (uint32_t)BCDevice::ID::Console, (uint8_t)BC::ID::Cons_Rev_Hw);
|
||||
|
||||
if(!hwVersion)
|
||||
{
|
||||
@@ -50,7 +51,7 @@ void BCTransmitter::onToggleConnectionState( bool connect )
|
||||
}
|
||||
|
||||
|
||||
void BCTransmitter::enqueueValueOp(BC::OpID opID, const BCDataItem* value)
|
||||
void BCTransmitter::enqueueValueOp(BC::OpID opID, const BCDataValue* value)
|
||||
{
|
||||
QMutexLocker locker(&_mutex);
|
||||
_valueQueue.enqueue( value );
|
||||
@@ -83,7 +84,7 @@ void BCTransmitter::processValueOp( BC::OpID opID )
|
||||
|
||||
while (true)
|
||||
{
|
||||
const BCDataItem* currentValue{};
|
||||
const BCDataValue* currentValue{};
|
||||
{
|
||||
QMutexLocker locker(&_mutex);
|
||||
if (_valueQueue.isEmpty())
|
||||
@@ -106,11 +107,11 @@ void BCTransmitter::processValueOp( BC::OpID opID )
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t BCTransmitter::readRawValue( BCDevice::ID deviceID, BC::ID registerID ) const
|
||||
uint32_t BCTransmitter::readRawByte( uint32_t deviceID, uint8_t registerID ) const
|
||||
{
|
||||
try
|
||||
{
|
||||
return _canDriver.readRawValue( deviceID, registerID );
|
||||
return _canDriver.readRawByte( deviceID, registerID );
|
||||
}
|
||||
catch ( BCException& exception )
|
||||
{
|
||||
@@ -119,11 +120,11 @@ uint32_t BCTransmitter::readRawValue( BCDevice::ID deviceID, BC::ID registerID )
|
||||
|
||||
}
|
||||
|
||||
void BCTransmitter::writeRawValue( BCDevice::ID deviceID, BC::ID registerID, uint8_t value ) const
|
||||
void BCTransmitter::writeRawByte( uint32_t deviceID, uint8_t registerID , uint8_t value ) const
|
||||
{
|
||||
try
|
||||
{
|
||||
_canDriver.writeRawValue( deviceID, registerID, value );
|
||||
_canDriver.writeRawByte( deviceID, registerID, value );
|
||||
}
|
||||
catch ( BCException& exception )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user