XER10-2389: Gateway LED lite solid white in WFO mode #4
Conversation
…as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk XER10-2389: Gateway LED lite solid white in WFO mode while using XLE as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk XER10-2389: Gateway LED lite solid white in WFO mode while using XLE as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk XER10-2389: Gateway LED lite solid white in WFO mode while using XLE as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk XER10-2389: Gateway LED lite solid white in WFO mode while using XLE as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk XER10-2389: Gateway LED lite solid white in WFO mode while using XLE as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk XER10-2389: Gateway LED lite solid white in WFO mode while using XLE as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk XER10-2389: Gateway LED lite solid white in WFO mode while using XLE as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk XER10-2389: Gateway LED lite solid white in WFO mode while using XLE as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk XER10-2389: Gateway LED lite solid white in WFO mode while using XLE as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk
There was a problem hiding this comment.
Pull request overview
Adds RBUS-driven WAN primary/backup interface event handling so the LED manager can react to WFO failover/fallback scenarios (e.g., avoiding incorrect solid-white behavior by emitting explicit “backup active” / “primary active” events).
Changes:
- Subscribes to
Device.X_RDK_WanManager.InterfaceActiveStatusand translates status updates into new LED events (eWanBackupActive,eWanPrimaryActive). - Adjusts build wiring so the TR-181 middle-layer (including RBUS handler) is built/linked consistently, and gates WebConfig-specific RBUS elements behind
LEDMGR_WEBCONFIG. - Exposes
handle_event()for use by the RBUS handler and adds locking around event handling.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| source/TR-181/middle_layer_src/Makefile.am | Updates include/link flags; makes json-schema wrapper link conditional and (should) align feature toggles with LEDMGR_WEBCONFIG. |
| source/TR-181/middle_layer_src/ledmgr_rbus_handler_apis.c | Adds WAN interface status RBUS subscription and emits new LED events; wraps WebConfig-related RBUS elements with LEDMGR_WEBCONFIG. |
| source/TR-181/middle_layer_src/ledmgr_plugin_main_apis.c | Guards WebConfig init call behind LEDMGR_WEBCONFIG. |
| source/Makefile.am | Builds TR-181 subdir unconditionally to support RBUS handler usage. |
| source/LedManager/Makefile.am | Makes LedManager depend on the TR-181 middle-layer library unconditionally. |
| source/LedManager/led_manager.h | Adds new event enum values for WAN backup/primary activity. |
| source/LedManager/led_manager.c | Always includes RBUS handler header and always initializes RBUS. |
| source/LedManager/led_manager_events.c | Exposes handle_event() and adds mutex protection around event processing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
source/TR-181/middle_layer_src/ledmgr_rbus_handler_apis.c:840
- LedMgr_Rbus_Init subscribes to Device.X_RDK_WanManager.InterfaceActiveStatus, but LedMgr_Rbus_Exit never unsubscribes from it before closing the rbus handle. This can leak subscriptions / generate errors on shutdown. Also, LedMgr_Rbus_UnSubscribeDML should only run when LEDMGR_WEBCONFIG subscriptions were actually created.
ANSC_STATUS LedMgr_Rbus_Exit()
{
CcspTraceInfo(("%s %d - LedMgr_RbusExit called\n", __FUNCTION__, __LINE__ ));
#ifdef LEDMGR_WEBCONFIG
rbus_unregDataElements(rbusHandle, NUM_OF_RBUS_PARAMS, ledMgrRbusDataElements);
#endif
LedMgr_Rbus_UnSubscribeDML();
rbus_close(rbusHandle);
return ANSC_STATUS_SUCCESS;
| libCcspLedManager_middle_layer_src_la_CPPFLAGS += -I$(top_srcdir)/source/TR-181/middle_layer_src/json_schema_validator_wrapper | ||
| libCcspLedManager_middle_layer_src_la_SOURCES = ledmgr_dml_apis.c ledmgr_plugin_main_apis.c cJSON.c secure_wrapper.c | ||
| libCcspLedManager_middle_layer_src_la_LDFLAGS = -lccsp_common -lsyscfg -lsysevent -lpthread -ljson_schema_validator_wrapper -lsecure_wrapper -lm | ||
| libCcspLedManager_middle_layer_src_la_LDFLAGS = -lccsp_common -lsyscfg -lsysevent -lpthread -lsecure_wrapper -lm | ||
|
|
||
| if FEATURE_LEDMGR_WEBCONFIG | ||
| libCcspLedManager_middle_layer_src_la_LDFLAGS += -ljson_schema_validator_wrapper |
…as backup mode Reason for change: Send primary and backup events from rbus handler and handle the events Test Procedure: Test WFO use cases Risks: Low Signed-off-by: biju.vijayanindiradevi@sky.uk
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
source/TR-181/middle_layer_src/Makefile.am:32
- The added include path points to a non-existent directory (middle_layer_src/json_schema_validator_wrapper). The repo’s header lives under source/TR-181/json_schema_validator_wrapper, so WebConfig builds may still fail to find json_schema_validator_wrapper.h.
libCcspLedManager_middle_layer_src_la_CPPFLAGS += -I$(top_srcdir)/source/TR-181/middle_layer_src/json_schema_validator_wrapper
| #ifdef LEDMGR_WEBCONFIG | ||
| ret = rbusEvent_Unsubscribe(rbusHandle, LEDMGR_WEBCONFIG_FULLJSON_DATA); | ||
| if(ret != RBUS_ERROR_SUCCESS) | ||
| { | ||
| CcspTraceError(("%s %d - Failed to Subscribe %s, Error=%s \n", __FUNCTION__, __LINE__, LEDMGR_WEBCONFIG_FULLJSON_DATA, rbusError_ToString(ret))); | ||
| } | ||
| #endif |
There was a problem hiding this comment.
I want to keep existing webconfig implementation as it is . This ActiveStatus change is nothing to do with brightness and onoff data
| ANSC_STATUS LedMgr_RbusExit() | ||
| ANSC_STATUS LedMgr_Rbus_Exit() | ||
| { | ||
| CcspTraceInfo(("%s %d - LedMgr_RbusExit called\n", __FUNCTION__, __LINE__ )); |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (3)
source/TR-181/middle_layer_src/Makefile.am:32
- The json_schema_validator_wrapper header lives under source/TR-181/json_schema_validator_wrapper, but this Makefile adds an include path to source/TR-181/middle_layer_src/json_schema_validator_wrapper (which doesn't exist). When LEDMGR_WEBCONFIG is enabled, including json_schema_validator_wrapper.h will fail to compile unless another global include path happens to provide it.
libCcspLedManager_middle_layer_src_la_CPPFLAGS += -I$(top_srcdir)/source/TR-181/middle_layer_src/json_schema_validator_wrapper
source/TR-181/middle_layer_src/ledmgr_rbus_handler_apis.c:779
- This is an unsubscribe error path, but the log says "Failed to Subscribe", which is misleading during troubleshooting.
CcspTraceError(("%s %d - Failed to Subscribe %s, Error=%s \n", __FUNCTION__, __LINE__, LEDMGR_WEBCONFIG_FULLJSON_DATA, rbusError_ToString(ret)));
source/TR-181/middle_layer_src/ledmgr_rbus_handler_apis.c:841
- The function was renamed to LedMgr_Rbus_Exit, but this log string still says "LedMgr_RbusExit", making logs harder to correlate with the actual symbol name.
CcspTraceInfo(("%s %d - LedMgr_RbusExit called\n", __FUNCTION__, __LINE__ ));
| static void WanInterfaceStatusHandler(rbusHandle_t handle, rbusEvent_t const* event, rbusEventSubscription_t* subscription) | ||
| { | ||
| rbusValue_t value = NULL; | ||
| const char* status = NULL; | ||
| const char* eventName = NULL; |
| pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; | ||
|
|
||
| static unsigned int wan_backup_status; | ||
| extern int handle_event(cpe_event_t event); |
| cpe_event_t ledmgr_get_wan_event_from_str (char * event_str); | ||
| #endif | ||
| static int handle_event(cpe_event_t event) | ||
| int handle_event(cpe_event_t event) |
| CcspTraceInfo(("%s:%d Notification for %s : %s\n",__FUNCTION__, __LINE__, eventName, status)); | ||
|
|
||
| /* HOTSPOT,0|DOCSIS,0|WANOE,1|REMOTE_LTE,0 */ | ||
| if(strstr(status, "DOCSIS,1") || strstr(status, "WANOE,1") || strstr(status, "DSL,1")) |
There was a problem hiding this comment.
Hardcoding could be a problem, for example XF10 uses PON, and maybe a celular based router would use celullar
XER10-2389: Gateway LED lite solid white in WFO mode
Reason for change: Send primary and backup events from rbus handler and handle the events
Test Procedure: Test WFO use cases
Risks: Low
Signed-off-by: biju.vijayanindiradevi@sky.uk