Skip to content
Commit eef2aa88 authored by Emil Gydesen's avatar Emil Gydesen Committed by Johan Hedberg
Browse files

Bluetooth: CTS: Fix issue with writing without subscription



The write_ct function calls bt_cts_send_notification and if
bt_cts_send_notification fails to send a notification (e.g.
if there are no clients subscribed), it would return an
error, and thus send a ATT error response to the client,
even if the value was actually written.

This commit changes the behavior so that the notification
does not affect the return value (as it is not directly
linked to the write itself), but rather just logs it if
it fails to send the notification.

The notification can failed to be send for 2 main reasons:
1) The application returns an error on fill_current_cts_time
2) bt_gatt_notify fails to notify due to missing buffers

The first we cannot do much about. For the latter we can
either just live with the missing notification, or implement
a retry if we run out of buffers. For this simple fix the
former was chosen, but can be revisited if it turns out
to be a significant problem.

Signed-off-by: default avatarEmil Gydesen <emil.gydesen@nordicsemi.no>
parent 184b633f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment