<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrfconnect app displays old services and characteristics evenafter reprogramming the board.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74314/nrfconnect-app-displays-old-services-and-characteristics-evenafter-reprogramming-the-board</link><description>Hi, 
 
 I am using nrfconnect to debug my application code. i have an application code with 9 services in total and it is working fine as expected. 
 Now the problem is, if i program the device with any ble examples, the nrf connect displays all of the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Apr 2021 12:44:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74314/nrfconnect-app-displays-old-services-and-characteristics-evenafter-reprogramming-the-board" /><item><title>RE: nrfconnect app displays old services and characteristics evenafter reprogramming the board.</title><link>https://devzone.nordicsemi.com/thread/307490?ContentTypeID=1</link><pubDate>Thu, 29 Apr 2021 12:44:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25199a35-1351-43fc-9257-f0b99c0fe74c</guid><dc:creator>madblue</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;sorry, forgot to update it here.&lt;/p&gt;
&lt;p&gt;It is not happening now with the zephyr application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfconnect app displays old services and characteristics evenafter reprogramming the board.</title><link>https://devzone.nordicsemi.com/thread/307478?ContentTypeID=1</link><pubDate>Thu, 29 Apr 2021 12:19:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67003297-33fc-4aab-8e41-68890594ef94</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve looked through the Zephyr Host API, but I couldn&amp;#39;t find anything that was equivalent to the Peer manager function I pointed to earlier. Looks maybe &amp;quot;service changed&amp;quot; is handled automatically in the stack (in gatt.c). Are you still experiencing problems with caching?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfconnect app displays old services and characteristics evenafter reprogramming the board.</title><link>https://devzone.nordicsemi.com/thread/306849?ContentTypeID=1</link><pubDate>Mon, 26 Apr 2021 14:37:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7527dce-81b3-403c-9d63-3e36817a0b19</guid><dc:creator>madblue</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My new application is written using nrfconnect sdk.&lt;/p&gt;
&lt;p&gt;How can i add this feature to my nrfconnect sdk based application? is there any api available to replace the &lt;em&gt;&amp;quot;&amp;nbsp;&lt;span class="item"&gt;&lt;a class="" title="pm_local_database_has_changed" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__peer__manager.html?cp=7_1_6_2_16_43#gaaecb7f99f58d71f085f62f5cc5267508"&gt;pm_local_database_has_changed&lt;/a&gt;&lt;/span&gt;()&amp;nbsp;&amp;quot; ?&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfconnect app displays old services and characteristics evenafter reprogramming the board.</title><link>https://devzone.nordicsemi.com/thread/306398?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 15:06:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01399aed-96d7-440c-a42e-296ed5594d88</guid><dc:creator>madblue</dc:creator><description>&lt;p&gt;Thank you Vidar.&lt;/p&gt;
&lt;p&gt;I will try that out later and get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfconnect app displays old services and characteristics evenafter reprogramming the board.</title><link>https://devzone.nordicsemi.com/thread/306377?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 14:02:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c93c37f7-d15f-4ad9-bbe7-812d7240746a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Having the Service changed characteristic present should be enough to disable caching for the devices that are not bonded. For bonded devices, however, you will need to send a service changed indication to make the client do a new service. You can use the &lt;span class="item"&gt;&lt;a class="" title="pm_local_database_has_changed" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__peer__manager.html?cp=7_1_6_2_16_43#gaaecb7f99f58d71f085f62f5cc5267508"&gt;pm_local_database_has_changed&lt;/a&gt;&lt;/span&gt;() function for this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfconnect app displays old services and characteristics evenafter reprogramming the board.</title><link>https://devzone.nordicsemi.com/thread/306374?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 13:51:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93dba29e-52c5-4efd-a3dc-a590a6cecf61</guid><dc:creator>madblue</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the quick reply.&lt;/p&gt;
&lt;p&gt;It shows the actual services once i give the refresh service command from nrf connect app.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_SDH_BLE_SERVICE_CHANGED was already set in the sdk_config file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;how can we force the service changed field from the server end ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;
#ifndef NRF_SDH_BLE_SERVICE_CHANGED
#define NRF_SDH_BLE_SERVICE_CHANGED 1
#endif
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#008080;"&gt;&lt;em&gt;Are you testing with Android or iOS?&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;I have both ios and android phones.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfconnect app displays old services and characteristics evenafter reprogramming the board.</title><link>https://devzone.nordicsemi.com/thread/306357?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 13:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abee48ac-2028-4e59-be4b-f2b41ba9780e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]It shows actual services and chara in the phones that were not used to debug on that device previously with my application code. i have tried erasing all the app data, pairing information and also given a network settings reset but does not work.[/quote]
&lt;p&gt;&amp;nbsp;This should normally clear the attribute cache and force a new service discovery on subsuquent connection. Strange that it&amp;#39;s not working. Are you testing with Android or iOS? The android version of nRF connect has a button you can press to manually start service discovery.&lt;/p&gt;
&lt;p&gt;You may try to enable the &amp;#39;NRF_SDH_BLE_SERVICE_CHANGED&amp;#39; setting in sdk_config.h. This will prevent caching for un-bonded devices.&lt;/p&gt;
&lt;p&gt;Excerpt from the core spec on attribute caching rules:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;2.5.2 Attribute caching&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;em&gt;Attribute caching is an optimization that allows the client to discover the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Attribute information such as Attribute Handles used by the server once and&lt;/em&gt;&lt;br /&gt;&lt;em&gt;use the same Attribute information across reconnections without rediscovery. If&lt;/em&gt;&lt;br /&gt;&lt;em&gt;the client does not cache the Attribute information, then it must rediscover the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Attribute information at each reconnection. With caching, time is saved and a&lt;/em&gt;&lt;br /&gt;&lt;em&gt;significant number of packets need not be exchanged between the client and&lt;/em&gt;&lt;br /&gt;&lt;em&gt;server. The Attribute information that shall be cached by a client is the Attribute&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Handles of all server attributes and the GATT service characteristics values.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Attribute Handles used by the server should not change over time. This means&lt;/em&gt;&lt;br /&gt;&lt;em&gt;that once an Attribute Handle is discovered by a client the Attribute Handle for&lt;/em&gt;&lt;br /&gt;&lt;em&gt;that Attribute should not be changed.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;em&gt;Some circumstances may cause servers to change the Attribute Handles used&lt;/em&gt;&lt;br /&gt;&lt;em&gt;for services, perhaps due to a factory reset or a firmware upgrade procedure&lt;/em&gt;&lt;br /&gt;&lt;em&gt;being performed. The following is only required on the server if the services on&lt;/em&gt;&lt;br /&gt;&lt;em&gt;the server can be added, modified or removed. If GATT based services on the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;server cannot be changed during the usable lifetime of the device, the Service&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Changed characteristic shall not exist on the server and the client does not&lt;/em&gt;&lt;br /&gt;&lt;em&gt;need to ever perform service discovery after the initial service discovery for that&lt;/em&gt;&lt;br /&gt;&lt;em&gt;server.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;To support caching when a server supports changes in GATT based services,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;an indication is sent by the server to clients when a service is added, removed,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;or modified on the server. A client may also detect a service change by reading&lt;/em&gt;&lt;br /&gt;&lt;em&gt;the Database Hash characteristic if that characteristic exists on the server. A&lt;/em&gt;&lt;br /&gt;&lt;em&gt;GATT based service is considered modified if the binding of the Attribute&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Handles to the associated Attributes grouped within a service definition are&lt;/em&gt;&lt;br /&gt;&lt;em&gt;changed. Any change to the GATT service definition characteristic values other&lt;/em&gt;&lt;br /&gt;&lt;em&gt;than the Service Changed characteristic value and the Client Supported&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Features characteristic value themselves shall also be considered a&lt;/em&gt;&lt;br /&gt;&lt;em&gt;modification.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;em&gt;For clients that have a trusted relationship (i.e. bond) with the server, the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;attribute cache is valid across connections. For clients with a trusted&lt;/em&gt;&lt;br /&gt;&lt;em&gt;relationship and not in a connection when a service change occurs, the server&lt;/em&gt;&lt;br /&gt;&lt;em&gt;shall send an indication when the client reconnects to the server (see Section&lt;/em&gt;&lt;br /&gt;&lt;em&gt;7.1). For clients that do not have a trusted relationship with the server and that&lt;/em&gt;&lt;br /&gt;&lt;em&gt;do not support reading the Database Hash characteristic, the attribute cache is&lt;/em&gt;&lt;br /&gt;&lt;em&gt;valid only during the connection. Clients without a trusted relationship that do&lt;/em&gt;&lt;br /&gt;&lt;em&gt;support reading the Database Hash characteristic may validate the attribute&lt;/em&gt;&lt;br /&gt;&lt;em&gt;cache on connection setup. Clients without a trusted relationship shall receive&lt;/em&gt;&lt;br /&gt;&lt;em&gt;an indication when the service change occurs only during the current&lt;/em&gt;&lt;br /&gt;&lt;em&gt;connection.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;em&gt;Note: Clients without a trusted relationship that support caching must either&lt;/em&gt;&lt;br /&gt;&lt;em&gt;perform service discovery or detect service changes by reading the Database&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Hash characteristic on each connection if the server supports the Service&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Changed characteristic.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;em&gt;The server shall send an ATT_HANDLE_VALUE_IND PDU containing the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;range of affected Attribute Handles that shall be considered invalid in the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;client’s attribute cache. The start Attribute Handle shall be the start Attribute&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Handle of the service definition containing the change and the end Attribute&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Handle shall be the last Attribute Handle of the service definition containing the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;change. The value in the indication is composed of two 16-bit Attribute Handles&lt;/em&gt;&lt;br /&gt;&lt;em&gt;concatenated to indicate the affected Attribute Handle range.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Note: A server may set the affected Attribute Handle range to 0x0001 to&lt;/em&gt;&lt;br /&gt;&lt;em&gt;0xFFFF to indicate to the client to rediscover the entire set of Attribute Handles&lt;/em&gt;&lt;br /&gt;&lt;em&gt;on the server.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;em&gt;If the Database Hash characteristic exists on the server then, each time a&lt;/em&gt;&lt;br /&gt;&lt;em&gt;service change occurs, the server shall update the Database Hash&lt;/em&gt;&lt;br /&gt;&lt;em&gt;characteristic value with the new Database Hash (see Section 7.3).&lt;/em&gt;&lt;br /&gt;&lt;em&gt;If the Database Hash characteristic value has changed since the last time it&lt;/em&gt;&lt;br /&gt;&lt;em&gt;was read, the client shall consider its attribute cache invalid and shall not make&lt;/em&gt;&lt;br /&gt;&lt;em&gt;use of the cached information until it has performed service discovery or&lt;/em&gt;&lt;br /&gt;&lt;em&gt;obtained the changed database definitions using an out-of-band mechanism&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The client, upon receiving an ATT_HANDLE_VALUE_IND PDU containing the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;range of affected Attribute Handles, shall consider the attribute cache invalid&lt;/em&gt;&lt;br /&gt;&lt;em&gt;over the affected Attribute Handle range. Any outstanding request transaction&lt;/em&gt;&lt;br /&gt;&lt;em&gt;shall be considered invalid if the Attribute Handle is contained within the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;affected Attribute Handle range. The client must perform service discovery&lt;/em&gt;&lt;br /&gt;&lt;em&gt;before the client uses any service that has an attribute within the affected&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Attribute Handle range. Alternatively, the client may read the Database Hash&lt;/em&gt;&lt;br /&gt;&lt;em&gt;characteristic and obtain the changed database definitions using an out-ofband&lt;/em&gt;&lt;br /&gt;&lt;em&gt;mechanism. If the client receives an ATT_HANDLE_VALUE_IND PDU&lt;/em&gt;&lt;br /&gt;&lt;em&gt;during service discovery and the client has read the Database Hash&lt;/em&gt;&lt;br /&gt;&lt;em&gt;characteristic prior to the service discovery, the client may read the Database&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Hash characteristic again to determine if the current service discovery can be&lt;/em&gt;&lt;br /&gt;&lt;em&gt;continued or if a new service discovery is required.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;em&gt;Once the server has received the ATT_HANDLE_VALUE_CFM PDU, the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;server can consider the client to be aware of the updated Attribute Handles.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;The client shall consider the affected Attribute Handle range to be invalid in its&lt;/em&gt;&lt;br /&gt;&lt;em&gt;attribute cache and perform the discovery procedures to restore the attribute&lt;/em&gt;&lt;br /&gt;&lt;em&gt;cache. The server&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>