22 void setup()
override;
32 void send(uint8_t
address, uint8_t function_code, uint16_t start_address, uint16_t number_of_entities,
33 uint8_t payload_len = 0,
const uint8_t *payload =
nullptr);
34 void send_raw(
const std::vector<uint8_t> &payload);
59 virtual void on_modbus_data(
const std::vector<uint8_t> &data) = 0;
62 void send(uint8_t
function, uint16_t start_address, uint16_t number_of_entities, uint8_t payload_len = 0,
63 const uint8_t *payload =
nullptr) {
64 this->
parent_->send(this->address_,
function, start_address, number_of_entities, payload_len, payload);
66 void send_raw(
const std::vector<uint8_t> &payload) { this->
parent_->send_raw(payload); }
std::vector< uint8_t > rx_buffer_
bool parse_modbus_byte_(uint8_t byte)
void set_send_wait_time(uint16_t time_in_ms)
void set_role(ModbusRole role)
void send_raw(const std::vector< uint8_t > &payload)
void send(uint8_t address, uint8_t function_code, uint16_t start_address, uint16_t number_of_entities, uint8_t payload_len=0, const uint8_t *payload=nullptr)
std::vector< ModbusDevice * > devices_
float get_setup_priority() const override
GPIOPin * flow_control_pin_
void set_flow_control_pin(GPIOPin *flow_control_pin)
bool waiting_for_response()
void dump_config() override
void send_raw(const std::vector< uint8_t > &payload)
void set_disable_crc(bool disable_crc)
void set_address(uint8_t address)
void set_parent(Modbus *parent)
uint32_t last_modbus_byte_
uint8_t waiting_for_response
virtual void on_modbus_error(uint8_t function_code, uint8_t exception_code)
Implementation of SPI Controller mode.
void register_device(ModbusDevice *device)
void send(uint8_t function, uint16_t start_address, uint16_t number_of_entities, uint8_t payload_len=0, const uint8_t *payload=nullptr)
virtual void on_modbus_read_registers(uint8_t function_code, uint16_t start_address, uint16_t number_of_registers)