RDKBWIFI-364 : Generalizing bus abstraction functions for retrieving and setting bus data property types.#1020
RDKBWIFI-364 : Generalizing bus abstraction functions for retrieving and setting bus data property types.#1020hp490 wants to merge 1 commit intordkcentral:developfrom
Conversation
|
Gerrit link: https://gerrit.teamccp.com/#/c/952003/ (for internal comcast builds) |
6e5a004 to
69aac56
Compare
…and setting bus data property types. Reason for change : Converted the generic raw_data type to bus_data_prop_t. Risks: Medium Priority:P0 Test Procedure: Flash the image and verify that all OneWifi-related features work properly.
|
gerrit: https://gerrit.teamccp.com/#/c/952499/ (26Q2_sprint) |
There was a problem hiding this comment.
Pull request overview
This PR updates the RDKB/HE bus abstraction to use bus_data_prop_t (property-list style payloads) instead of the older generic raw_data_t for method/event object handling, enabling generalized retrieval/setting of bus object/property types.
Changes:
- Added RBUS object-to-
bus_data_prop_tconversion and updated RBUS method/event paths to use property-list payloads. - Updated multiple consumer callback signatures/usages across the codebase to accept
bus_data_prop_t/he_bus_data_object_t. - Hardened
bus_release_data_propto safely handleNULLinputs and optionalnum_proptracking.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| source/platform/rdkb/bus.c | Introduces RBUS object/property list conversion and updates method/event handlers to use bus_data_prop_t. |
| source/platform/linux/he_bus/src/he_bus_data_conversion.c | Adjusts subscribe-callback invocation to pass he_bus_data_object_t and simplifies userdata usage. |
| source/platform/linux/he_bus/inc/he_bus_core.h | Updates consumer subscription callback typedef to accept he_bus_data_object_t*. |
| source/platform/common/data_model/wfa/wfa_data_model.c | Updates sync handler signatures to use bus_data_prop_t*. |
| source/platform/common/bus_common.h | Updates bus method and event subscription handler typedefs to use bus_data_prop_t*. |
| source/platform/common/bus_common.c | Makes bus_release_data_prop tolerant of NULL p_data_prop / num_prop. |
| source/dml/dml_webconfig/dml_onewifi_api.c | Updates event callback to read payload from bus_data_prop_t.value. |
| source/db/wifi_db_apis.c | Updates subscription handler signature to use bus_data_prop_t*. |
| source/core/wifi_ctrl_rbus_handlers.c | Updates multiple event handlers and one method handler to use bus_data_prop_t.value. |
| source/apps/sm/wifi_sm.c | Updates SM event handler to consume bus_data_prop_t.value. |
| source/apps/csi/wifi_csi_analytics.c | Updates placeholder handler signature to use bus_data_prop_t*. |
Comments suppressed due to low confidence (1)
source/apps/sm/wifi_sm.c:842
- This subscription callback is invoked from the bus layer with a
(char*, bus_data_prop_t*, void*)signature. Defining it with only two parameters is undefined behavior when called through the expected function pointer type (even ifuserDatais always NULL today). Update the handler signature to accept theuserDataparameter (and ignore it if unused) to match the bus callback type.
static void sm_app_enable_handler(char *event_name, bus_data_prop_t *p_data)
{
bool sm_app_enable;
wifi_util_dbg_print(WIFI_SM, "%s:%d recvd event\n", __func__, __LINE__);
if ((strcmp(event_name, BUS_SM_APP_ENABLE) != 0) ||
(p_data->value.data_type != bus_data_type_boolean)) {
wifi_util_error_print(WIFI_SM, "%s:%d invalid event received,%s:%x\n", __func__, __LINE__,
event_name, p_data->value.data_type);
return;
}
sm_app_enable = p_data->value.raw_data.b;
push_event_to_ctrl_queue(&sm_app_enable, sizeof(sm_app_enable), wifi_event_type_command,
wifi_event_type_sm_app_enable, NULL);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| goto cleanup; | ||
| } | ||
| memcpy(prop->name, prop_name, name_len + 1); | ||
| prop->name_len = (uint32_t)name_len; |
There was a problem hiding this comment.
bus_data_prop_t.name_len appears to be treated elsewhere as the string length including the null terminator (e.g., bus_set_raw_data_prop sets name_len = strlen(event_name) + 1). Here name_len is set to strlen(prop_name) (excluding the terminator), which can break any code that uses name_len for serialization/copying. Set prop->name_len to include the terminating '\0' (or align with the project’s established name_len semantics).
| prop->name_len = (uint32_t)name_len; | |
| prop->name_len = (uint32_t)(name_len + 1); |
| rbusProperty_Init(&p, prop_name, v); | ||
| rbusObject_SetProperty(outParams, p); | ||
| rbusProperty_Release(p); | ||
| rbusValue_Release(v); |
There was a problem hiding this comment.
After rbusProperty_Init + rbusObject_SetProperty, the rbusObject_t/rbusProperty_t typically owns the rbusValue_t (see bus_method_invoke in this file where the value is not explicitly released after attaching it to an object). Releasing v here risks a use-after-free/double-release when RBUS later cleans up outParams. Consider removing the explicit rbusValue_Release(v) (or otherwise ensure ownership semantics are correct).
| rbusValue_Release(v); |
Reason for change : Converted the generic raw_data type to bus_data_prop_t.
Risks: Medium
Priority: P0
Test Procedure: Flash the image and verify that all OneWifi-related features work properly.