Setting the gatts_enable_params.service_changed to 0 when enabling softdevice removes (or rather doesn't add) the Service Changed characteristic. That's what I want. However it still leaves behind (adds) the Generic Attribute service which is now empty and left me wondering why it's there although I don't explicitly add it anywhere. Searching the forums yielded some results:
devzone.nordicsemi.com/.../ unanswered
Generic Attribute Service is mandatory to have, so you are not able to remove this.
however
so removing this will be possible, most likely in the next softdevice release.
The included links in those answers and additional google searches didn't provide any clear answers. Reading the BLUETOOTH SPECIFICATION Version 4.2 [Vol 3, Part G] page 577 says thus:
7 DEFINED GENERIC ATTRIBUTE PROFILE SERVICE
All characteristics defined within this section shall be contained in a primary service with the service UUID set to «GATT Service» as defined in Section 3.1. Only one instance of the GATT service shall be exposed on a GATT server.
Table 7.1 lists characteristics that may be present in the server and the characteristics that may be supported by the client.
C1: Mandatory if service definitions on the server can be added, changed or removed; otherwise optional
This is the only reference I can find to Generic Attribute [Profile] Service and anything mandatory. The way I'm reading this is that
- The Service Changed characteristic is only mandatory to be supported by any client
- The Service Changed characteristic is not mandatory on the server if the service definitions can't be changed
- Although the characteristic shall be contained in the [[GATT Service]], it says nothing about requiring the service if the characteristic is not present.
I admit that I'm not the smartest chip on the board and my specification-reading skills might not be up to par, so maybe I'm wrong. However I just want to understand if it really is mandatory to have the empty service and why. Especially since there are answers from Nordic employees to support either view.