Create dummy devices, part I
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
#include <bccandrivertinycan.h>
|
||||
|
||||
|
||||
//#define UNLIMITED_SPEED_VALUE 70 /* Km/h */
|
||||
//#define UNLIMITED_MIN_SPEED_VALUE 30 /* Km/h */
|
||||
//#define MAX_THROTTLE_SPEED_VALUE 70 /* Km/h */
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include <QRandomGenerator>
|
||||
|
||||
#include <bccandrivertinycan.h>
|
||||
|
||||
|
||||
#include <can_drv.h>
|
||||
//#include "mhstcan.h"
|
||||
|
||||
|
||||
BCCanDriverTinyCan::BCCanDriverTinyCan( QObject* parent )
|
||||
: BCCanDriver(parent )
|
||||
@@ -121,6 +112,12 @@ bcdata_t BCCanDriverTinyCan::readRawValue( BCDevice::ID deviceID, BC::ID registe
|
||||
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));
|
||||
return myRandomByte;
|
||||
|
||||
//value.fromValue<bcdata_t>( myRandomByte );
|
||||
|
||||
TCanMsg msg;
|
||||
|
||||
uint32_t device = static_cast<uint32_t>(deviceID);
|
||||
@@ -190,6 +187,7 @@ void BCCanDriverTinyCan::writeRawValue( BCDevice::ID deviceID, BC::ID registerID
|
||||
throw BCException( "writeRawValue error: driver not loaded." );
|
||||
|
||||
qDebug() << " --- BCCanDriverTinyCan writeRawValue: " << value;
|
||||
return;
|
||||
|
||||
uint32_t device = static_cast<uint32_t>(deviceID);
|
||||
uint8_t reg = static_cast<uint8_t> (registerID);
|
||||
|
||||
Reference in New Issue
Block a user