| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- /*
- * @file NbusBridge.h
- * @brief Deklarácia modulu nBus Brige
- * @date Mar 7, 2025
- * @author Juraj Dudak
- */
- #ifndef SRC_NBUSBRIDGE_H_
- #define SRC_NBUSBRIDGE_H_
- #include "NbusSlave.h"
- /* DEFINES BEGIN */
- #define MAX_SLAVES 16
- #define MODULE_ADDRESS(packet) packet[0]
- #define SENSOR_ADDRESS(packet) packet[1]
- #define FUNCTION_CODE(packet) packet[2]
- /* DEFINES END */
- class NbusBridge {
- private:
- NbusCommunicator *_communicator;
- NbusSlave _slaves[MAX_SLAVES];
- uint8_t _num_slaves;
- void transmit(DataFrame *packet);
- DataFrame *_frame_nbus_internal;
- public:
- NbusBridge(NbusCommunicator *);
- virtual ~NbusBridge();
- void scan();
- uint8_t getNumSlaves();
- bool call_echo(uint8_t slave);
- NbusSlave * getSlave(uint8_t index);
- void sendResponseToMaster(DataFrame *response_frame);
- void processRequest(uint8_t *rxFrame);
- };
- #endif /* SRC_NBUSBRIDGE_H_ */
|