Cleanups.
This commit is contained in:
@@ -160,8 +160,14 @@ BCDriver::DriverState BCDriverTinyCan::connectDriver()
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief BCDriverTinyCan::readRawByte
|
||||
* Kapselt den Treiberzugiff über die legacy C-Api. Liest ein byte, gibt dieses im std::expected aber
|
||||
* als uint32_t zurück, um mit der ReadFunctions der ValueTypes kompatible zu sein.
|
||||
* Im Fehlerfall wird ein Fehlerstring zurückgegeben.
|
||||
*/
|
||||
|
||||
BCDriver::TransmitResult BCDriverTinyCan::readRawByte( uint32_t deviceID, uint8_t registerID ) const
|
||||
TransmitResult BCDriverTinyCan::readRawByte( uint32_t deviceID, uint8_t registerID ) const
|
||||
{
|
||||
|
||||
//TransmitResult
|
||||
@@ -223,13 +229,13 @@ retry:
|
||||
if( !timeOuts )
|
||||
return std::unexpected(QString("CAN response errror: timeout" ));
|
||||
|
||||
return (uint8_t) msg.MsgData[3];
|
||||
return (uint32_t) msg.MsgData[3];
|
||||
|
||||
}
|
||||
|
||||
|
||||
// void BCDriverTinyCan::setValue( unsigned char receipient, unsigned char reg, unsigned char value )
|
||||
BCDriver::TransmitResult BCDriverTinyCan::writeRawByte( uint32_t deviceID, uint8_t registerID ,uint8_t value ) const
|
||||
TransmitResult BCDriverTinyCan::writeRawByte( uint32_t deviceID, uint8_t registerID ,uint8_t value ) const
|
||||
{
|
||||
|
||||
if( getDriverState() != DriverState::DeviceReady)
|
||||
@@ -256,6 +262,6 @@ BCDriver::TransmitResult BCDriverTinyCan::writeRawByte( uint32_t deviceID, uint8
|
||||
if( timeout_count == -1 )
|
||||
return std::unexpected(QString("error: could not send value to %1" ).arg( deviceID ) );
|
||||
|
||||
return 1; // als 'true'
|
||||
return uint32_t(1); // als 'true'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user