1 of 1 people found this helpful
Attribute protocol allows server to reply 2 ways to the Write Request. The first is to send Write Response which acknowledges the write and passes no parameters. The second is to send Error Response which carries an Error Code which indicates the reason why operation was unsuccessful. In the WICED Smart SDK when application's Write Handler returns something other than zero, the stack sends the Error Response rather than the Write Response. (See cycling_... sample.) The stack can also generate the Error Response without even calling the callback. For example if GATT database indicates that the authenticated writes should be used, but client attempts to write over unencrypted link. Or when client tries to write too big of a value.
It depends on your client implementation on how the error response is processed and if how your application is notified. I hope it answers your question, because I do not understand the problem. To enable indications client needs to write 0x02 into client configuration descriptor of that characteristic. The fact that client has registered does not mean that you need to send indications right away. You can have your own logic when to do it. For example if you implement a weight scale client can register, and you may need to send indication only after somebody stands up on the scale. That depends on the requirements of the profile you are implementing.