mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 02:39:57 +02:00
25 lines
612 B
C++
25 lines
612 B
C++
#ifndef MODBUS_INVERTER_PROTOCOL_H
|
|
#define MODBUS_INVERTER_PROTOCOL_H
|
|
|
|
#include <stdint.h>
|
|
#include "../lib/eModbus-eModbus/ModbusServerRTU.h"
|
|
#include "HardwareSerial.h"
|
|
#include "InverterProtocol.h"
|
|
|
|
extern uint16_t mbPV[];
|
|
|
|
// The abstract base class for all Modbus inverter protocols
|
|
class ModbusInverterProtocol : public InverterProtocol {
|
|
protected:
|
|
// Create a ModbusRTU server instance with 2000ms timeout
|
|
ModbusInverterProtocol() : MBserver(2000) { mbPV = ::mbPV; }
|
|
|
|
static const int MB_RTU_NUM_VALUES = 13100;
|
|
|
|
// Modbus register file
|
|
uint16_t* mbPV;
|
|
|
|
ModbusServerRTU MBserver;
|
|
};
|
|
|
|
#endif
|