mgmt: mcumgr: callbacks: Fix not checking event ID properly
Fixes an issue whereby event ID was not checked properly, meaning that OR'd events would not work as one would expect. Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
parent
90c558f581
commit
d0e421225a
1 changed files with 4 additions and 2 deletions
|
@ -106,9 +106,11 @@ int32_t mgmt_callback_notify(uint32_t event, void *data, size_t data_size)
|
|||
struct mgmt_callback *loop_group =
|
||||
CONTAINER_OF(snp, struct mgmt_callback, node);
|
||||
|
||||
if (loop_group->event_id == event || loop_group->event_id == MGMT_EVT_OP_ALL ||
|
||||
if (loop_group->event_id == MGMT_EVT_OP_ALL ||
|
||||
(MGMT_EVT_GET_GROUP(loop_group->event_id) == group &&
|
||||
MGMT_EVT_GET_ID(loop_group->event_id) == MGMT_EVT_OP_ID_ALL)) {
|
||||
(MGMT_EVT_GET_ID(event) & MGMT_EVT_GET_ID(loop_group->event_id)) ==
|
||||
MGMT_EVT_GET_ID(event))) {
|
||||
|
||||
rc = loop_group->callback(event, return_rc, &abort_more, data, data_size);
|
||||
|
||||
if (rc != MGMT_ERR_EOK && failed == false) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue