I wrote a reply to a 5-year old question which appeared to be related to my needs but the answer was not what I was looking for.
The case is very straight forward:
The client writes a command on a control point, however, the client has not yet enabled the control point to receive indications.
Consequently, I would like to respond to the BLE_GATTS_EVT_WRITE event with an error. I was hoping for some SoftDevice method like sd_gatts_write_rsp(_) where I could set the error code the client is to receive since I cannot indicate an error message on the control point.
The message sequence diagrams show how I can edit/modify/block a write request from entering crap into my service tables database, but there is no way that I have found to send a reply to the client. I have worked on other libraries where I could do this, in fact I was responsible for setting all the responses to write requests. Maybe SoftDevice is just trying to simplify my life by handling all responses under the hood; implicitly assuming it can handle all possible needs.
I think the error code I want to respond with is 0xFD (Client Characteristic Configuration Descriptor Improperly Configured).
How can I do this (I do not see how the write with authentication option SoftDevice provides helps). There is still no control over the response to the client in that case. I do use that option to control what gets read and could use it to control what gets written. It's not what I need here.
As an aside there is a button to the right with that toggles between 'turn notifications on' or 'turn notifications off'. It is not clear what the state of notifications are given the text displayed. If I see 'off' I am assuming notifications are on and vice versa. It would be clearer with 'notifications are now on' and 'notifications are now off' as the toggle options.