Added dummy can driver.

This commit is contained in:
2025-12-30 14:42:49 +01:00
parent f170b3835d
commit fbeb4fb3c0
6 changed files with 73 additions and 16 deletions

View File

@@ -35,10 +35,11 @@
#include <bctransmitter.h>
BCTransmitter::BCTransmitter(QObject *parent)
: QObject(parent), _isBusy(false)
{
//_canDriver = new BCDriverTinyCan{this};
_canDriver = new BCDriverDummy{this};
}
@@ -46,11 +47,11 @@ void BCTransmitter::onToggleConnectionState( bool connect )
{
if( connect )
{
if( _canDriver.getState() != BCDriver::DriverState::Ready )
_canDriver.onStartDriver();
if( _canDriver->getState() != BCDriver::DriverState::Ready )
_canDriver->onStartDriver();
// fix!
uint32_t hwVersion = _canDriver.readRawByte( (uint32_t)BCDevice::ID::Console, (uint8_t)BC::ID::Cons_Rev_Hw);
uint32_t hwVersion = _canDriver->readRawByte( (uint32_t)BCDevice::ID::Console, (uint8_t)BC::ID::Cons_Rev_Hw);
if(!hwVersion)
{
@@ -158,7 +159,7 @@ uint32_t BCTransmitter::readRawByte( uint32_t deviceID, uint8_t registerID ) c
uint32_t result{};
try
{
result = _canDriver.readRawByte( deviceID, registerID );
result = _canDriver->readRawByte( deviceID, registerID );
}
catch ( BCException& exception )
{
@@ -172,7 +173,7 @@ void BCTransmitter::writeRawByte( uint32_t deviceID, uint8_t registerID , uint8_
{
try
{
_canDriver.writeRawByte( deviceID, registerID, value );
_canDriver->writeRawByte( deviceID, registerID, value );
}
catch ( BCException& exception )
{