Enhance Gateway Network and Runtime Functionality
- Added a check in GatewayNetworkService::handleDaliRawFrame to ensure raw reporting is enabled for the gateway before processing the frame. - Extended the JSON snapshot in GatewayNetworkService::gatewaySnapshotJson to include additional operation-related fields for each channel, providing more detailed status information. - Updated GatewayRuntime::classifyCommandPriority to include new opcodes (0x66 and 0x67) in the control command classification, improving command handling. Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
@@ -1298,6 +1298,9 @@ void GatewayNetworkService::handleDaliRawFrame(const DaliRawFrame& frame) {
|
||||
if (!espnow_started_ || !espnow_connected_ || frame.data.empty()) {
|
||||
return;
|
||||
}
|
||||
if (!controller_.rawReportingEnabled(frame.gateway_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
cJSON* payload = cJSON_CreateObject();
|
||||
if (payload == nullptr) {
|
||||
@@ -1606,6 +1609,13 @@ std::string GatewayNetworkService::gatewaySnapshotJson() {
|
||||
cJSON_AddNumberToObject(item, "groupMaskHigh", channel.group_mask_high);
|
||||
cJSON_AddBoolToObject(item, "isAllocAddr", channel.allocating);
|
||||
cJSON_AddNumberToObject(item, "lastAllocAddr", channel.last_alloc_addr);
|
||||
cJSON_AddBoolToObject(item, "operationActive", channel.operation_active);
|
||||
cJSON_AddNumberToObject(item, "operationRequestId", channel.operation_request_id);
|
||||
cJSON_AddNumberToObject(item, "operationId", channel.operation_id);
|
||||
cJSON_AddNumberToObject(item, "operationStatus", channel.operation_status);
|
||||
cJSON_AddNumberToObject(item, "operationProgress", channel.operation_progress);
|
||||
cJSON_AddNumberToObject(item, "operationTarget", channel.operation_target);
|
||||
cJSON_AddNumberToObject(item, "operationCount", channel.operation_count);
|
||||
cJSON_AddItemToArray(channels, item);
|
||||
}
|
||||
cJSON_AddItemToObject(root, "channels", channels);
|
||||
@@ -1757,4 +1767,4 @@ esp_err_t GatewayNetworkService::HandleJqJsGet(httpd_req_t* req) {
|
||||
return httpd_resp_send_chunk(req, nullptr, 0);
|
||||
}
|
||||
|
||||
} // namespace gateway
|
||||
} // namespace gateway
|
||||
|
||||
Reference in New Issue
Block a user