cancel
Showing results for 
Search instead for 
Did you mean: 

Service changed indication

grzegorz
Associate III
Posted on May 19, 2017 at 13:04

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-ms
5 REPLIES 5
Posted on May 22, 2017 at 09:40

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 devices

that services have changed (i.e., added, removed or modified). The

characteristic shall be used to indicate to clients that have a trusted relationship

(i.e. bond) with the server when GATT based services have changed when

they 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,

GM
Posted on May 22, 2017 at 21:53

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»?

nick239955_stm1_st
Associate II
Posted on August 28, 2017 at 01:10

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?

nick239955_stm1_st
Associate II
Posted on August 28, 2017 at 03:41

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?

Posted on August 29, 2017 at 16:00

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

http://www.st.com/content/st_com/en/products/embedded-software/wireless-connectivity-software/stsw-bnrgui.html

 using another BlueNRG-MS device acting as a client.

Kind regards