mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 10:56:43 +00:00
[modbus] Command lifecycle: PDU-carrying callbacks, on_sent(), notified queue clearing (#17886)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
56028d0932
commit
19511f5787
@@ -306,7 +306,8 @@ class ModbusController final : public PollingComponent, public modbus::ModbusCli
|
||||
/// controller-level raw sends stay supported until the command machinery is replaced.
|
||||
void send_raw(const std::vector<uint8_t> &payload) {
|
||||
if (payload.empty()) {
|
||||
this->on_not_sent(); // match the hub-level send_raw(): a refused send is always signalled
|
||||
// Through the guard like every other delivery, so a handler calling send_raw({}) cannot recurse.
|
||||
this->trigger_not_sent({});
|
||||
return;
|
||||
}
|
||||
this->parent_->send_pdu(payload[0], std::span<const uint8_t>(payload).subspan(1), this);
|
||||
|
||||
Reference in New Issue
Block a user