<?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>Define a service dynamically</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107754/define-a-service-dynamically</link><description>Hi, 
 I am trying to define a service at runtime because we want that the Service UUID may be changed according to a configuration variable. 
 I have set CONFIG_BT_GATT_DYNAMIC_DB=y 
 And added the code: 
 
 static struct bt_uuid_128 uuid ; 
 uuid = </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Feb 2024 13:10:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107754/define-a-service-dynamically" /><item><title>RE: Define a service dynamically</title><link>https://devzone.nordicsemi.com/thread/467173?ContentTypeID=1</link><pubDate>Thu, 01 Feb 2024 13:10:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9123083e-b348-4d37-89ea-ca10686d40aa</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Mads,&lt;br /&gt;&lt;br /&gt;We do not have any examples that showscases the process to update services dynamically specifically, unfortunately.&lt;br /&gt;&lt;br /&gt;Do you see the other services as expected before and after the attempt to register this service? Do they also work as expected both before and after the addition of this one? If so, is the only issue that the new service does not show up, everything else works as expected?&lt;br /&gt;&lt;br /&gt;Could you also share more of the relevant code here, so that I may see if there could be an issue with the sequencing of the calls?&lt;br /&gt;For instance, &lt;a href="https://docs.zephyrproject.org/apidoc/latest/group__bt__gatt__server.html#gab4d9cfea04e44445d5dc30ad52842b64"&gt;have you made sure that settings_load has been called and finished before this is run&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Define a service dynamically</title><link>https://devzone.nordicsemi.com/thread/466724?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 10:51:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c7a6ebc-2c92-47af-ade6-ac442773c383</guid><dc:creator>Mads Sig</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Thanks, I deleted the bond info in the APP, but it did not solve the problem.&lt;/p&gt;
&lt;p&gt;Do you have an example of how you have defined a service dynamically?&lt;/p&gt;
&lt;p&gt;Br Mads&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Define a service dynamically</title><link>https://devzone.nordicsemi.com/thread/466722?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 10:41:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab2c1fa4-302b-4c97-8a6e-167e613626b7</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Mads,&lt;br /&gt;&lt;br /&gt;Thank you for your patience with this.&lt;/p&gt;
[quote user=""]Bluetooth dynamic service registration (result 0)[/quote]
&lt;p&gt;The result 0 indicates that the operation was a success, and so the new service is added to the ATT table.&lt;/p&gt;
[quote user=""]But the service is not available, when I connect to my device with a smartphone using the nRF Connect APP.[/quote]
&lt;p&gt;Are you using bonding with your device? Could it be that your smartphone has cached the ATT table from the peripheral device previously, and that your peripheral does not use the &amp;#39;Services Changed&amp;#39; service to prompt a new discovery from the central device?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>