Cleanup datatypes.

This commit is contained in:
2025-12-23 14:58:54 +01:00
parent 01912c75ef
commit b219a71cba
10 changed files with 80 additions and 42 deletions

View File

@@ -83,7 +83,7 @@ BCCanDriver::DriverState BCCanDriverTinyCan::initDriver()
unsigned int retry = _timeOuts;
emit statusHint( "Driver Init: putting BCDevice::ID::Console in slave mode ... " );
bcdata_t isSlave = 0;
uint32_t isSlave = 0;
do
{
writeRawValue( BCDevice::ID::Console, BC::ID::Cons_Status_Slave, 1 );
@@ -105,18 +105,17 @@ BCCanDriver::DriverState BCCanDriverTinyCan::initDriver()
}
bcdata_t BCCanDriverTinyCan::readRawValue( BCDevice::ID deviceID, BC::ID registerID ) const
uint32_t BCCanDriverTinyCan::readRawValue( BCDevice::ID deviceID, BC::ID registerID ) const
{
if( getState() != DriverState::Ready)
throw BCException( "readRawValue error: driver not loaded." );
//bcdata_t result = transmitter.readRawValue( deviceID, registerID );
bcdata_t myRandomByte = static_cast<quint8>(QRandomGenerator::global()->bounded(256));
//uint32_t result = transmitter.readRawValue( deviceID, registerID );
uint32_t myRandomByte = static_cast<uint32_t>(QRandomGenerator::global()->bounded(256));
return myRandomByte;
//value.fromValue<bcdata_t>( myRandomByte );
//value.fromValue<uint32_t>( myRandomByte );
TCanMsg msg;
@@ -174,13 +173,13 @@ retry:
if( !timeOuts )
throw BCException( "CAN --response errror" );
return (bcdata_t) msg.MsgData[3];
return (uint32_t) msg.MsgData[3];
}
// void BCCanDriverTinyCan::setValue( unsigned char receipient, unsigned char reg, unsigned char value )
void BCCanDriverTinyCan::writeRawValue( BCDevice::ID deviceID, BC::ID registerID, bcdata_t value ) const
void BCCanDriverTinyCan::writeRawValue( BCDevice::ID deviceID, BC::ID registerID, uint8_t value ) const
{
if( getState() != DriverState::Ready)