Files
BionxControl/bccandrivertinycan.h
2025-12-24 12:11:59 +01:00

48 lines
1.1 KiB
C++

#ifndef BCCANDRIVERTINYCAN_H
#define BCCANDRIVERTINYCAN_H
#include <bccandriver.h>
class BCCanDriverTinyCan : public BCCanDriver
{
Q_OBJECT
public:
explicit BCCanDriverTinyCan( QObject* parent=nullptr );
virtual ~BCCanDriverTinyCan() = 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;
QString getNodeName( unsigned char id );
protected:
// 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";
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 BIB = 0x048;
};
#endif // BCCANDRIVERTINYCAN_H