Added debug config
This commit is contained in:
@@ -24,18 +24,14 @@ namespace drivers
|
||||
static const uint8_t PORT = 1;
|
||||
|
||||
public:
|
||||
#ifdef ESP32
|
||||
RS485(const uint32_t baud, const SerialConfig conf);
|
||||
#else
|
||||
RS485(const uint32_t baud);
|
||||
#endif
|
||||
const bool write(const std::vector<uint8_t> data);
|
||||
const bool readAll(std::vector<uint8_t> &data);
|
||||
const bool readN(const uint16_t nBytes, std::vector<uint8_t> &data);
|
||||
const bool readUntil(const uint8_t ch, std::vector<uint8_t> &data);
|
||||
|
||||
private:
|
||||
std::unique_ptr<HardwareSerial> m_serial;
|
||||
HardwareSerial &m_serial;
|
||||
};
|
||||
|
||||
class MODBUS : public RS485
|
||||
@@ -65,11 +61,8 @@ namespace drivers
|
||||
typedef uint16_t crc_t;
|
||||
|
||||
public:
|
||||
#ifdef ESP32
|
||||
|
||||
MODBUS(const uint32_t baud, const SerialConfig conf);
|
||||
#else
|
||||
MODBUS(const uint32_t baud);
|
||||
#endif
|
||||
|
||||
// Func 0x01
|
||||
const bool readCoils(const uint8_t device, const uint16_t reg, const uint16_t num, std::vector<bool> &coils);
|
||||
|
||||
Reference in New Issue
Block a user