<?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>GAP &amp;quot;Device name&amp;quot; handler value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30678/gap-device-name-handler-value</link><description>When my device received name change request from central, I can catch this event (for updating device name in FDS) by callback *_on_ble_evt , event ID BLE_GATTS_EVT_WRITE and write handler 0x03. Value 0x03 was hardcoded in my firmware, but I suppose it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Feb 2018 13:38:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30678/gap-device-name-handler-value" /><item><title>RE: GAP "Device name" handler value</title><link>https://devzone.nordicsemi.com/thread/121390?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 13:38:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:187cf405-a327-4a7e-a6d9-1cf7fa76b87f</guid><dc:creator>ekrashtan</dc:creator><description>&lt;p&gt;Yes, that&amp;#39;s what I exactly mean. The simple difference in current SDK:&lt;/p&gt;
&lt;p&gt;instead of mentioned&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_evt_write-&amp;gt;context.char_uuid.uuid&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;now it looks like&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_evt_write-&amp;gt;uuid.uuid&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(from&amp;nbsp;ble_gatts_evt_write_t typedef)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Compiled and tested, the solution works fine. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GAP "Device name" handler value</title><link>https://devzone.nordicsemi.com/thread/121388?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 13:26:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3066be5-d9bd-4122-a78d-be9518883dee</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]When my device received name change request from central, I can catch this event (for updating device&amp;nbsp;name in FDS)&amp;nbsp; by callback &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;*_on_ble_evt&lt;/span&gt;, event ID&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;BLE_GATTS_EVT_WRITE&lt;/span&gt; and write handler 0x03. Value 0x03 was hardcoded in my firmware, but I suppose it looks like bad code style.[/quote]
&lt;p&gt;I would recommend doing it by checking the UUID written to. Device name has it&amp;#39;s own UUID, so if you get a write to that specific UUID, you can add logic for storing the name as well.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a rather old (but still valid) thread on the same matter, which includes code on how to filter out this specific event:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/10539/device-name-change/39211#39211"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/10539/device-name-change/39211#39211&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let me know if you have any issues implementing this.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>