48 lines
1.2 KiB
C++
48 lines
1.2 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;
|
|
|
|
bcdata_t readRawValue ( BCDevice::ID deviceID, BC::ID registerID ) const override;
|
|
void writeRawValue( BCDevice::ID deviceID, BC::ID registerID, bcdata_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
|