feat(gateway): implement serial communication handling in DaliDomainService and GatewayController
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -98,6 +98,7 @@ class GatewayRuntime {
|
||||
std::optional<std::vector<uint8_t>> popNextCommand();
|
||||
void completeCurrentCommand();
|
||||
bool hasPendingQueryCommand(const std::vector<uint8_t>& command) const;
|
||||
bool hasActiveQueryCommand(uint8_t gateway_id) const;
|
||||
CommandDropReason lastEnqueueDropReason() const;
|
||||
|
||||
void setGatewayCount(size_t gateway_count);
|
||||
|
||||
@@ -334,6 +334,12 @@ bool GatewayRuntime::hasPendingQueryCommand(const std::vector<uint8_t>& command)
|
||||
});
|
||||
}
|
||||
|
||||
bool GatewayRuntime::hasActiveQueryCommand(uint8_t gateway_id) const {
|
||||
LockGuard guard(command_lock_);
|
||||
return current_command_.has_value() && isQueryCommand(*current_command_) &&
|
||||
current_command_->size() > 2 && (*current_command_)[2] == gateway_id;
|
||||
}
|
||||
|
||||
GatewayRuntime::CommandDropReason GatewayRuntime::lastEnqueueDropReason() const {
|
||||
LockGuard guard(command_lock_);
|
||||
return last_enqueue_drop_reason_;
|
||||
|
||||
Reference in New Issue
Block a user