2017-05-19 04:04 AM
The Generic Attribute service (0x1801) has Service Changed characteristic (0x2A05). They are added automatically by Aci_Gatt_Init. Does BlueNRG-MS stack send indications with this characteristc when services and characteristics are being added or removed? Or I need to send indications manually? Central devices, e.g. mobiles phones, cache services and they need to be notified by Service Changed characteristic so they can rescan peripheral device and update their cache.
#cache #bluenrg-ms2017-05-22 12:40 AM
Dear Customer,
To receive the indication from BlueNRG-MS peripheral (related to Service Changed characteristic), the central has to enable the indication using the command ACI_GATT_WRITE_CHAR_DESC and the devices have to be bonded.
As you can see in the 'Specification of the Bluetooth System' :
'7.1 SERVICE CHANGED
The «Service Changed» characteristic is a control-point attribute (as defined in[Vol 3] Part F, Section 3.2.6) that shall be used to indicate to connected devicesthat services have changed (i.e., added, removed or modified). Thecharacteristic shall be used to indicate to clients that have a trusted relationship(i.e. bond) with the server when GATT based services have changed whenthey re-connect to the server. See Section 2.5.2.If the indication is enabled, the server/peripheral will send an indication to the central
Regards,
GM2017-05-22 02:53 PM
Thanks for reply but that's not what I asked about. I need to now if BlueNRG-MS stack sends these indications automatically when a service or characteristic is added or removed. How can I make BlueNRG-MS peripheral send indications on «Service Changed»?
2017-08-27 04:10 PM
Hi,
Did this question ever get answered as now I have the same question. i.e. Does the BLUENRG-MS automatically send the service changed indication or if not how can I make it send this indication?
2017-08-27 06:41 PM
I found in the BLUENRG programming manual (PM0237) that the attribute handle for the Attribute profile service is 0x01 and the handle for the service changed characteristic is 0x03. Therefore I used these handle values with the aci_gatt_update_char_value() function to update the value of this characteristic and generate an indication but got a return value of 0x61 (BLE_STATUS_INVALID_PARAMETER). I called this function after receiving the EVT_BLUE_GATT_ATTRIBUTE_MODIFIED callback when the indication for this characteristic had been enabled.
Any reason why I would be getting this error?
2017-08-29 09:00 AM
Dear Customer,
the steps suggested by Graziella are correct.
Notice that you don't need to update the value of the Service Changed characteristic. Once the bonded client enables indications (on the same characteristic) it will be automatically indicated about any change on the GATT service data base (e.g., the deletion of an existing service). However, the refresh of the service list depends on the client implementation (i.e., Android and iOS may have different behavior). You could try the
using another BlueNRG-MS device acting as a client.Kind regards