Reworked driver code.

This commit is contained in:
2026-01-01 00:40:27 +01:00
parent 54e89e412a
commit 3ed3511f50
9 changed files with 201 additions and 212 deletions

View File

@@ -44,9 +44,6 @@ public:
explicit BCDriverTinyCan( QObject* parent=nullptr );
virtual ~BCDriverTinyCan() = default;
DriverState loadDriver() override;
DriverState initDriver() override;
uint32_t readRawByte ( uint32_t deviceID, uint8_t registerID ) const override;
void writeRawByte( uint32_t deviceID, uint8_t registerID, uint8_t value ) const override;
@@ -54,26 +51,26 @@ public:
protected:
void loadDriver();
void initDriver();
// typen?
//void setValue( unsigned char receipient, unsigned char reg, unsigned char value );
//unsigned int getValue( unsigned char receipient, unsigned char reg );
void awaitReceiveBuf( int timeout );
void awaitSendBuf(int timeout );
const char* CBCDLL_LIN = "libmhstcan.so";
const char* CBCDLL_WIN = "mhstcan.dll";
//const char* CBCDLL_LIN = "libmhstcan.so";
//const char* CBCDLL_WIN = "mhstcan.dll";
static constexpr int cRetries = 5;
static constexpr int cTimeOuts = 20;
static constexpr int cTIMEOUT_MS = 10; // 10ms
static constexpr int cTIMEOUT_COUNT = 10;
static constexpr int cTIMEOUT_MS = 10; // 10ms
static constexpr int cTIMEOUT_COUNT = 10;
const unsigned int BATTERY = 0x010;
const unsigned int MOTOR = 0x020;
//const unsigned int BATTERY = 0x010;
//const unsigned int MOTOR = 0x020;
const unsigned int BIB = 0x048;