Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDKB-51547 - [On rbusDirect] Implementation of RBUS Publish API to send Raw Data #190

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/core/rbuscore.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,10 @@ rbusCoreError_t rbus_registerObj(const char * object_name, rbus_callback_t handl
server_object_create(&obj, object_name, handler, user_data);

//TODO: callback signature translation. rbusMessage uses a significantly wider signature for callbacks. Translate to something simpler.
err = rtConnection_AddListenerWithId(g_connection, object_name, RBUS_REGISTER_OBJECT_EXPRESSION_ID, onMessage, obj);
err = rtConnection_AddListener(g_connection, object_name, onMessage, obj); /* Avoiding rtConnection_AddListenerWithId call here as ccsp code
uses this rbus_registerObj() function call directly and usage
of rtConnection_AddListenerWithId() function will result in
conflict with subscriptionId */

if(RT_OK == err)
{
Expand Down Expand Up @@ -957,10 +960,10 @@ rbusCoreError_t rbus_unregisterObj(const char * object_name)
RBUSCORELOG_ERROR("object_name is invalid.");
return RBUSCORE_ERROR_INVALID_PARAM;
}
err = rtConnection_RemoveListenerWithId(g_connection, object_name, RBUS_REGISTER_OBJECT_EXPRESSION_ID);
err = rtConnection_RemoveListener(g_connection, object_name);
if(RT_OK != err)
{
RBUSCORELOG_ERROR("rtConnection_RemoveListenerWithId %s failed: Err=%d", object_name, err);
RBUSCORELOG_ERROR("rtConnection_RemoveListener %s failed: Err=%d", object_name, err);
return RBUSCORE_ERROR_GENERAL;
}

Expand Down
3 changes: 1 addition & 2 deletions src/core/rbuscore.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
#define MAX_SUPPORTED_METHODS 32
#define MAX_REGISTERED_OBJECTS 64
#define RBUS_OPEN_TELEMETRY_DATA_MAX 512
#define RBUS_REGISTER_OBJECT_EXPRESSION_ID 2
#define RBUS_ADVISORY_EXPRESSION_ID 3
#define RBUS_ADVISORY_EXPRESSION_ID 2

void rbus_getOpenTelemetryContext(const char **s, const char **t);
void rbus_setOpenTelemetryContext(const char *s, const char *t);
Expand Down
3 changes: 1 addition & 2 deletions src/rbus/rbus_subscriptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ rbusSubscription_t* rbusSubscriptions_addSubscription(rbusSubscriptions_t subscr
rbusSubscription_t* sub;
TokenChain* tokens;

static uint32_t subscriptionId = 4; /* Starting the subscription ID with 4 as the initial 3 values are allocated for the below add listener
static uint32_t subscriptionId = 3; /* Starting the subscription ID with 3 as the initial 2 values are allocated for the below add listener
rtconnection create internal
rbus register object
client advisory */

RBUSLOG_DEBUG("adding %s %s", listener, eventName);
Expand Down
Loading