mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 03:16:37 +00:00
[modbus] Rework the client queue as a per-frame state machine (#17922)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
co-authored by
Claude Fable 5
J. Nick Koston
parent
5821915aad
commit
d38a458de9
@@ -305,11 +305,8 @@ class ModbusController final : public PollingComponent, public modbus::ModbusCli
|
||||
/// Deliberately shadows the deprecated ModbusClientDevice::send_raw() with identical semantics:
|
||||
/// controller-level raw sends stay supported until the command machinery is replaced.
|
||||
void send_raw(const std::vector<uint8_t> &payload) {
|
||||
if (payload.empty()) {
|
||||
// Through the guard like every other delivery, so a handler calling send_raw({}) cannot recurse.
|
||||
this->trigger_not_sent({});
|
||||
return;
|
||||
}
|
||||
if (payload.empty())
|
||||
return; // refused at the door, like every invalid send; no callback follows
|
||||
this->parent_->send_pdu(payload[0], std::span<const uint8_t>(payload).subspan(1), this);
|
||||
}
|
||||
/// Registers a sensor with the controller. Called by esphomes code generator
|
||||
|
||||
Reference in New Issue
Block a user