| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- /**
- * @file NbusCommunicator.h
- * @brief Declaration of hardware communication interface.
- * @date Jun 23, 2026
- * @author Juraj Dudak, Matus Necas
- */
- #ifndef SRC_NBUSCOMMUNICATOR_H_
- #define SRC_NBUSCOMMUNICATOR_H_
- #include "inttypes.h"
- #include "dataframe.h"
- #include "nbus_config.h"
- #include "nbus_defines.h"
- /** @brief Interface for NBus Communicator handle.
- */
- class NbusCommunicator
- {
- public:
- /** Send data to master.
- * @param master_frame: data frame to send
- */
- virtual void sendToMaster(DataFrame *master_frame) = 0;
- /** Receive packet from master.
- * @return received data frame
- */
- virtual DataFrame* receiveFromMaster() = 0;
- /** Send data to slave.
- * @param slave_frame: data frame to send
- */
- virtual void sendToSlave(DataFrame *slave_frame) = 0;
- /** Receive data from slave.
- * @return received data frame
- */
- virtual DataFrame* receiveFromSlave() = 0;
- /** Set onboard LED to ON-state.
- */
- virtual void setLedOn() = 0;
-
- /** Set onboard LED to OFF-state.
- */
- virtual void setLedOff() = 0;
-
- /** Change onboard LED state.
- */
- virtual void toggleLed() = 0;
-
- /** Get actual elapsed time in ms.
- * @return time in ms
- */
- virtual uint32_t getTime() = 0;
- /** Send data to slave and receive response.
- * @param slave_frame: data frame to send
- * @return: response data frame
- */
- virtual DataFrame* sendAndReceiveSlave(DataFrame *slave_frame) = 0;
- };
- #endif /* SRC_NBUSCOMMUNICATOR_H_ */
|