![]() |
Dataflow Runtime API
3.0.3.0
|
Provides a mock implementation of the BSP driver. More...
#include <Imt.Base.BSP.Mock/DriverMock.h>
Public Member Functions | |
DriverMock () | |
Constructor. More... | |
virtual | ~DriverMock () |
Destructor. More... | |
imt::base::bsp::type::ErrorCode::Id | onRead (uint8_t *pData, const size_t size, uint8_t *const pBytesRead) |
Copies the read data to the given array, sets the number of bytes read and increments the read counter. More... | |
imt::base::bsp::type::ErrorCode::Id | onReadValue (bool *const pValue) |
Sets the value of the given pointer to true if the read value is greater than 0, false otherwhise. More... | |
imt::base::bsp::type::ErrorCode::Id | onReadValue (uint32_t *const pValue) |
Sets the value of the given pointer to the read value. More... | |
imt::base::bsp::type::ErrorCode::Id | onReadValue (float32_t *const pValue) |
Sets the value of the given pointer to the read value. More... | |
imt::base::bsp::type::ErrorCode::Id | onRegisterValueHandler (const size_t indexEndpoint, handler::HighLevelValueHandlerIfc *const pHandler) |
Registers the given handler for the given endpoint. More... | |
imt::base::bsp::type::ErrorCode::Id | onWrite (const uint8_t pData[], const uint32_t size, uint8_t *const pBytesWritten) |
Stores the data given by an array and increments the write counter. More... | |
imt::base::bsp::type::ErrorCode::Id | onWriteValue (const bool value) |
Stores the given value. More... | |
imt::base::bsp::type::ErrorCode::Id | onWriteValue (const uint32_t value) |
Stores the given value. More... | |
imt::base::bsp::type::ErrorCode::Id | onWriteValue (const float32_t value) |
Stores the given value. More... | |
imt::base::bsp::type::ErrorCode::Id | onUnregisterValueHandler (const size_t indexEndpoint) |
Unregisters the given handler for the given endpoint. More... | |
Static Public Attributes | |
static const size_t | MAX_DATA_SIZE = 1024U |
Maximum number of bytes to read or write. More... | |
Provides a mock implementation of the BSP driver.
imt::base::bsp::mock::DriverMock::DriverMock | ( | ) |
Constructor.
|
virtual |
Destructor.
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onRead | ( | uint8_t * | pData, |
const size_t | size, | ||
uint8_t *const | pBytesRead | ||
) |
Copies the read data to the given array, sets the number of bytes read and increments the read counter.
pData | The array the bytes will be written to. |
size | The maximal number of bytes to read (array size). |
pBytesRead | The actual number of bytes read. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onReadValue | ( | bool *const | pValue | ) |
Sets the value of the given pointer to true if the read value is greater than 0, false otherwhise.
pValue | Pointer to the value to be set. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onReadValue | ( | float32_t *const | pValue | ) |
Sets the value of the given pointer to the read value.
pValue | Pointer to the value to be set. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onReadValue | ( | uint32_t *const | pValue | ) |
Sets the value of the given pointer to the read value.
pValue | Pointer to the value to be set. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onRegisterValueHandler | ( | const size_t | indexEndpoint, |
handler::HighLevelValueHandlerIfc *const | pHandler | ||
) |
Registers the given handler for the given endpoint.
indexEndpoint | The index of the endpoint the handler has to be registered for. |
pHandler | The handler. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onUnregisterValueHandler | ( | const size_t | indexEndpoint | ) |
Unregisters the given handler for the given endpoint.
indexEndpoint | The index of the endpoint the handler has to be unregistered from. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onWrite | ( | const uint8_t | pData[], |
const uint32_t | size, | ||
uint8_t *const | pBytesWritten | ||
) |
Stores the data given by an array and increments the write counter.
pData | Array with data to be written. |
size | Number of bytes to write. |
pBytesWritten | Actual number of bytes written. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onWriteValue | ( | const bool | value | ) |
Stores the given value.
value | Value to be written. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onWriteValue | ( | const float32_t | value | ) |
Stores the given value.
value | Value to be written. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::onWriteValue | ( | const uint32_t | value | ) |
Stores the given value.
value | Value to be written. |
uint32_t imt::base::bsp::mock::DriverMock::m_enableInvokeCounter { 0U } |
Number of calls to the enable function.
uint32_t imt::base::bsp::mock::DriverMock::m_initializeInvokeCounter { 0U } |
Number of calls to the initialize function.
uint8_t imt::base::bsp::mock::DriverMock::m_readData[MAX_DATA_SIZE] {} |
Read data.
uint32_t imt::base::bsp::mock::DriverMock::m_readInvokeCounter { 0U } |
Number of calls to the data read function.
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::m_readReturnValue { imt::base::bsp::type::ErrorCode::OK } |
Error code of the read functions.
uint64_t imt::base::bsp::mock::DriverMock::m_readValue { 0U } |
Read value.
uint32_t imt::base::bsp::mock::DriverMock::m_reconfigureInvokeCounter { 0U } |
Number of calls to the reconfigure function.
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::m_reconfigureReturnValue { imt::base::bsp::type::ErrorCode::OK } |
Error code of the reconfigure function.
uint32_t imt::base::bsp::mock::DriverMock::m_startInvokeCounter { 0U } |
Number of calls to the start function.
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::m_startReturnValue { imt::base::bsp::type::ErrorCode::OK } |
Error code of the start function.
uint32_t imt::base::bsp::mock::DriverMock::m_stopInvokeCounter { 0U } |
Number of calls to the stop function.
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::m_stopReturnValue { imt::base::bsp::type::ErrorCode::OK } |
ErrorCode of the stop function.
std::map<size_t, handler::HighLevelValueHandlerIfc*> imt::base::bsp::mock::DriverMock::m_valueHandlerMap |
Map to store the registered handlers.
std::vector<uint8_t*> imt::base::bsp::mock::DriverMock::m_writeData {} |
Vector storing the written data.
uint32_t imt::base::bsp::mock::DriverMock::m_writeInvokeCounter { 0U } |
Number of calls to the data write function.
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::mock::DriverMock::m_writeReturnValue { imt::base::bsp::type::ErrorCode::OK } |
Error code of the write functions.
std::vector<uint64_t> imt::base::bsp::mock::DriverMock::m_writeValue {} |
Vector storing the written values.
|
static |
Maximum number of bytes to read or write.