Skip to content

Commit

Permalink
RDKB-51547 - [On rbusDirect] Implementation of RBUS Publish API to se…
Browse files Browse the repository at this point in the history
…nd Raw Data

Reason for change: Fixed the ssh failure issue reported in CI testing.
Test Procedure: Build and verified
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
  • Loading branch information
Gururaaja E S R authored and Gururaaja E S R committed Dec 26, 2023
1 parent 18f7a4c commit 2acbe1d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
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

0 comments on commit 2acbe1d

Please sign in to comment.