Skip to content

Commit bb903f0

Browse files
rakonsnordicjm
authored andcommitted
event_manager_proxy: Remove event name from subscribe function
This commit removes the redundant event name argument from event_manager_proxy_subscribe function. JIRA: NCSDK-20640 Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no> Signed-off-by: Divya Pillai <divya.pillai@nordicsemi.no>
1 parent b021970 commit bb903f0

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

doc/nrf/libraries/others/event_manager_proxy.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ Subscribing to remote events
119119
============================
120120

121121
A core that wishes to listen to events from the remote core sends ``SUBSCRIBE`` command to that core during the initialization process.
122-
The ``SUBSCRIBE`` command uses :c:func:`event_manager_proxy_subscribe` function, which passes following arguments:
122+
The ``SUBSCRIBE`` command is sent using the :c:func:`event_manager_proxy_subscribe` function, which passes the following arguments:
123123

124-
* ``local_event_id`` - This argument represents the local core ID that wishes to receive when the event is post-processed on the remote core.
125-
* ``remote_event_name`` - This argument represents the name of the event to be searched for.
124+
* ``ipc`` - This argument is an IPC instance that identifies the communication channel between the cores.
125+
* ``local_event_id`` - This argument represents the local core ID that is received when the event is post-processed on the remote core.
126+
It is also used to get the event name to match the same event on the remote core.
126127

127128
The remote core during the command processing searches for an event with the given name and registers the given event ID in an array of events.
128129
The created array of events directly reflects the array of event types.

doc/nrf/releases/release-notes-changelog.rst

+4
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,10 @@ Other libraries
540540

541541
* Added :c:macro:`APP_EVENT_ID` macro.
542542

543+
* :ref:`event_manager_proxy` library:
544+
545+
* Removed the ``remote_event_name`` argument from the :c:func:`event_manager_proxy_subscribe` function.
546+
543547
Common Application Framework (CAF)
544548
----------------------------------
545549

include/event_manager_proxy.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @return See @ref event_manager_proxy_subscribe.
3333
*/
3434
#define EVENT_MANAGER_PROXY_SUBSCRIBE(instance, ename) \
35-
event_manager_proxy_subscribe((instance), _EVENT_ID(ename), STRINGIFY(ename))
35+
event_manager_proxy_subscribe((instance), APP_EVENT_ID(ename))
3636

3737
/**
3838
* @brief Add remote core communication channel.
@@ -69,7 +69,6 @@ int event_manager_proxy_add_remote(const struct device *instance);
6969
*
7070
* @param instance Remote IPC instance.
7171
* @param local_event_id The id of the event we wish to receive for the event on the remote core.
72-
* @param remote_event_name The name of the event to register.
7372
*
7473
* @retval 0 On success.
7574
* @retval -EACCES Function called after @ref event_manager_proxy_start.
@@ -79,8 +78,7 @@ int event_manager_proxy_add_remote(const struct device *instance);
7978
*/
8079
int event_manager_proxy_subscribe(
8180
const struct device *instance,
82-
const struct event_type *local_event_id,
83-
const char *remote_event_name);
81+
const struct event_type *local_event_id);
8482

8583
/**
8684
* @brief Start events transfer.

subsys/event_manager_proxy/event_manager_proxy.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,13 @@ static int send_subscribe_command_to_remote(struct emp_ipc_data *ipc,
417417
}
418418

419419
int event_manager_proxy_subscribe(const struct device *instance,
420-
const struct event_type *local_event_id, const char *remote_event_name)
420+
const struct event_type *local_event_id)
421421
{
422422
__ASSERT_NO_MSG(!emp_started);
423423

424424
struct emp_ipc_data *ipc = find_ipc_by_instance(instance);
425425

426-
return send_subscribe_command_to_remote(ipc, local_event_id, remote_event_name);
426+
return send_subscribe_command_to_remote(ipc, local_event_id, local_event_id->name);
427427
}
428428

429429
static int send_start_command_to_remote(struct emp_ipc_data *ipc)

0 commit comments

Comments
 (0)