<?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>ble qos</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/129572/ble-qos</link><description>SETTINGS_STATIC_HANDLER_DEFINE(ble_qos, MODULE_NAME, NULL, settings_set, NULL,NULL); so how i have to call it ?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Nov 2026 13:07:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/129572/ble-qos" /><item><title>RE: ble qos</title><link>https://devzone.nordicsemi.com/thread/572941?ContentTypeID=1</link><pubDate>Fri, 06 Nov 2026 13:07:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9faaa35-2cb5-4326-97ad-5444a6037c4a</guid><dc:creator>Pallavi Patil</dc:creator><description>&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can implement the following code to call it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/settings/settings.h&amp;gt;

static uint32_t ble_interval;

static int ble_qos_set(const char *key, size_t len,
settings_read_cb read_cb, void *cb_arg)
{
const char *next;
int rc;

if (settings_name_steq(key, &amp;quot;interval&amp;quot;, &amp;amp;next) &amp;amp;&amp;amp; !next) {
if (len != sizeof(ble_interval)) {
return -EINVAL;
}
rc = read_cb(cb_arg, &amp;amp;ble_interval, sizeof(ble_interval));
if (rc &amp;gt;= 0) {
return 0;
}
return rc;
}

return -ENOENT;
}

SETTINGS_STATIC_HANDLER_DEFINE(ble_qos, &amp;quot;ble_qos&amp;quot;, NULL, ble_qos_set, NULL, NULL);

int main(void)
{
settings_subsys_init();
settings_load();
// ble_interval is now restored from storage

// Update the value and save it
ble_interval = 100;
settings_save_one(&amp;quot;ble_qos/interval&amp;quot;, &amp;amp;ble_interval, sizeof(ble_interval));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Call it &lt;/span&gt;&lt;strong&gt;after&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;code dir="ltr"&gt;settings_subsys_init()&lt;/code&gt;&lt;span&gt; and whenever the value changes and needs to be persisted.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please let me know if you have any issues while implementing.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Pallavi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>