10#ifndef SEMF_COMMUNICATION_CANHARDWARE_H_
11#define SEMF_COMMUNICATION_CANHARDWARE_H_
48 void write(
const uint8_t data[],
size_t dataSize)
override;
57 void read(uint8_t buffer[],
size_t bufferSize)
override;
109 bool m_isBusyWriting =
false;
111 static constexpr Error::ClassID kSemfClassId = Error::ClassID::CanHardware;
void write(const uint8_t data[], size_t dataSize) override
For writing data, dataWritten signal will be emitted after successful write.
void onError(Error thrown)
Is called if an error occurred by hardware read or write access. Will emit error signal.
ErrorCode
Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring...
virtual ~CanHardware()=default
void read(uint8_t buffer[], size_t bufferSize) override
For setting the read buffer. This has be done for getting a dataAvailable signal for handling the dat...
bool isBusyWriting() const override
Communication hardware is busy writing at the moment.
virtual void requestHardware()=0
virtual void setReadBuffer(uint8_t buffer[], size_t bufferSize)=0
Sets the read buffer for having the possibility to handle the received data.
virtual void writeHardware(const uint8_t data[], size_t dataSize)=0
Hardware will write data.
bool isBusyReading() const override
Communication hardware is busy reading at the moment.
void setBusyWriting(bool isBusy)
Sets the busy flag for writing.
Interface for CAN specific functionalities, which are not solved in a generic way in CommunicationHar...
This interface standardized the read and write interface for asynchronous hardware,...
Class for representing errors. Every error should have a unique source code. As a user feel encourage...