modbus_client.read_coils / read_discrete_inputs: on_response delivers the bits as a PackedBits view (bit 0 = the bit at start_address; only valid for the duration of the trigger).
More...
|
| | ReadBitsAction (bool coils) |
| |
| | TEMPLATABLE_VALUE (uint16_t, start_address) TEMPLATABLE_VALUE(uint16_t |
| |
| count Trigger< modbus::PackedBits > * | get_response_trigger () |
| |
| void | play (const Ts &...x) override |
| |
| void | on_read_bits (modbus::EntityType entity_type, uint16_t start_address, modbus::PackedBits bits, modbus::ResponseStatus status) override |
| |
| Trigger< std::span< const uint8_t >, std::span< const uint8_t > > * | get_custom_response_trigger () |
| |
| void | set_custom_response_handled () |
| | Set by codegen when the config declares on_custom_response.
|
| |
| void | on_custom_response (std::span< const uint8_t > request_pdu, std::span< const uint8_t > response_pdu, modbus::ResponseStatus status) override |
| |
| | TEMPLATABLE_VALUE (uint8_t, target_address) Trigger< std |
| |
| Trigger< std::span< const uint8_t >, modbus::ExceptionCode > * | get_error_trigger () |
| |
| Trigger< std::span< const uint8_t > > * | get_no_response_trigger () |
| |
| Trigger< std::span< const uint8_t > > * | get_not_sent_trigger () |
| |
| void | set_retry (retry_func_t f) |
| |
| void | on_sent (std::span< const uint8_t > request_pdu) override |
| | The frame was written to the wire: fires once per transmission, before any reply, and never for a send that ended in on_not_sent.
|
| |
| void | on_not_sent (std::span< const uint8_t > request_pdu) override |
| | Never reached the wire, from either of two sources.
|
| |
| void | on_error (std::span< const uint8_t > request_pdu, modbus::ExceptionCode exception_code) override |
| | A Modbus exception reply.
|
| |
| bool | on_no_response (std::span< const uint8_t > request_pdu) override |
| | No reply within send_wait_time.
|
| |
| void | play_complex (const Ts &...x) override |
| | Stamp the templated device address before every play(): subclasses cannot forget it, and the hub routes each reply by device pointer, so a changed address never mis-routes earlier replies.
|
| |
| virtual void | stop_complex () |
| |
| virtual bool | is_running () |
| | Check if this or any of the following actions are currently running.
|
| |
| int | num_running_total () |
| | The total number of actions that are currently running in this plus any of the following actions in the chain.
|
| |
| | ModbusClientDevice ()=default |
| |
| | ModbusClientDevice (ModbusClientHub *parent, uint8_t address) |
| |
| virtual | ~ModbusClientDevice () |
| |
| | ModbusClientDevice (const ModbusClientDevice &)=delete |
| |
| ModbusClientDevice & | operator= (const ModbusClientDevice &)=delete |
| |
| | ModbusClientDevice (ModbusClientDevice &&)=delete |
| |
| ModbusClientDevice & | operator= (ModbusClientDevice &&)=delete |
| |
| void | set_parent (ModbusClientHub *parent) |
| |
| void | set_address (uint8_t address) |
| |
| virtual void | on_response (std::span< const uint8_t > request_pdu, std::span< const uint8_t > response_pdu) |
| | Low-level response hook: called with the request PDU this device sent and the response PDU received The spans are only valid for the duration of the call - copy the bytes if they must outlive it.
|
| |
| | ESPDEPRECATED ("Override on_not_sent() instead. Removed in 2027.2.0", "2026.8.0") virtual void on_modbus_not_sent() |
| |
| | ESPDEPRECATED ("Override on_no_response() instead. Removed in 2027.2.0", "2026.8.0") virtual bool on_modbus_no_response() |
| |
| virtual void | on_read_registers (EntityType entity_type, uint16_t start_address, std::span< const uint16_t > registers, ResponseStatus status) |
| | High-level typed response callbacks, fired by the default on_response()/on_error() with arguments parsed from the request and response PDUs.
|
| |
| virtual void | on_read_holding_registers (uint16_t start_address, std::span< const uint16_t > registers, ResponseStatus status) |
| |
| virtual void | on_read_input_registers (uint16_t start_address, std::span< const uint16_t > registers, ResponseStatus status) |
| |
| virtual void | on_read_coils (uint16_t start_address, PackedBits bits, ResponseStatus status) |
| |
| virtual void | on_read_discrete_inputs (uint16_t start_address, PackedBits bits, ResponseStatus status) |
| |
| virtual void | on_write_single_register (uint16_t address, uint16_t value, ResponseStatus status) |
| | Write acknowledgements.
|
| |
| virtual void | on_write_single_coil (uint16_t address, bool value, ResponseStatus status) |
| |
| virtual void | on_write_multiple_registers (uint16_t start_address, std::span< const uint16_t > registers, ResponseStatus status) |
| |
| virtual void | on_write_multiple_coils (uint16_t start_address, PackedBits bits, ResponseStatus status) |
| |
| | ESPDEPRECATED ("Use the typed read_*/write_* helpers or queue_pdu() instead. Removed in 2027.2.0", "2026.8.0") void send(uint8_t function |
| |
template<typename... Ts>
class esphome::modbus_client::ReadBitsAction< Ts >
modbus_client.read_coils / read_discrete_inputs: on_response delivers the bits as a PackedBits view (bit 0 = the bit at start_address; only valid for the duration of the trigger).
Definition at line 170 of file modbus_client.h.