<?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>Checking if a client is connected to GATT server</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91287/checking-if-a-client-is-connected-to-gatt-server</link><description>Good day, 
 
 is there a way to check if a client is connected to GATT server/service? Would like to send a data after device gets reconnected. 
 i am using PCA10040 with SDK17.1. 
 
 thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 25 Aug 2022 11:20:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91287/checking-if-a-client-is-connected-to-gatt-server" /><item><title>RE: Checking if a client is connected to GATT server</title><link>https://devzone.nordicsemi.com/thread/383246?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 11:20:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2237213e-daa5-428d-9fe5-c19af1d3012a</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;You can register the service UUID with the discovery module. You&amp;#39;ll then be notified when the GATT Client does a service discovery of that service. For example, the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_nus_c.html?cp=8_1_4_2_0_7"&gt;ble_app_uart_c &lt;/a&gt;example registers the nus service with the discovery module by using&amp;nbsp;ble_nus_c_on_db_disc_evt() in&amp;nbsp;db_disc_handler(). If you look at the implementation of&amp;nbsp;ble_nus_c_on_db_disc_evt() in ble_nus_c.c you&amp;#39;ll see that the function checks if the NUS was discovered and then check what characteristics that was discovred. You can copy this approach for your own custom service and register it with the discovery module likewise.&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;br /&gt;I hope that helped,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>