Skip to content

Commit 618337d

Browse files
committed
bluetooth: hogp: Fix bt_hogp_rep_unsubscribe issue
The bt_hogp_rep_unsubscribe did not reset the rep->notify_cb, while bt_hogp_rep_subscribe returned an error if notify_cb was not null. Thus, it would be impossible to subscribe again to the report notification after unsubscribing. This commit fixes this. Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
1 parent f10635e commit 618337d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • subsys/bluetooth/services

subsys/bluetooth/services/hogp.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,9 +1031,13 @@ static uint8_t rep_notify_process(struct bt_conn *conn,
10311031
*/
10321032
if (data != NULL) {
10331033
rep->size = (uint8_t)length;
1034+
return rep->notify_cb(rep->hogp, rep, 0, data);
10341035
}
10351036

1036-
return rep->notify_cb(rep->hogp, rep, 0, data);
1037+
1038+
rep->notify_cb = NULL;
1039+
1040+
return BT_GATT_ITER_CONTINUE;
10371041
}
10381042

10391043
int bt_hogp_rep_subscribe(struct bt_hogp *hogp,

0 commit comments

Comments
 (0)