<?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>How are CTS (0x1805) services discovered when acting as a GATT Server with an ESP32 GATT Client</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67682/how-are-cts-0x1805-services-discovered-when-acting-as-a-gatt-server-with-an-esp32-gatt-client</link><description>Hi, 
 I&amp;#39;m using a nrf52832 based beacon with some sensors attached. To retrive the current time I use the CTS client. Actually, I&amp;#39;m following the ble_app_cts_c example to advertise, then perform a db_discovery and, if available e.g. from an iPhone, update</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Oct 2020 15:07:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67682/how-are-cts-0x1805-services-discovered-when-acting-as-a-gatt-server-with-an-esp32-gatt-client" /><item><title>RE: How are CTS (0x1805) services discovered when acting as a GATT Server with an ESP32 GATT Client</title><link>https://devzone.nordicsemi.com/thread/277433?ContentTypeID=1</link><pubDate>Wed, 28 Oct 2020 15:07:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26390694-534b-42d9-9a52-e3eaabde5e80</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Looking at the \ble_app_cts_c example I can find that&amp;nbsp;the application&amp;nbsp;is calling&amp;nbsp;db_discovery_init() during initialization.&lt;/p&gt;
&lt;p&gt;This means that on connection event with a peer the nRF52 will do a full database discovery of the peer.&lt;/p&gt;
&lt;p&gt;In the project I can find that the ble_cts_c will register a callback if the current time service is found on the peer. This is done by calling ble_db_discovery_evt_register() in&amp;nbsp;ble_cts_c_init(). This will ensure calling on_cts_c_evt() in main.c if found CTS is found on the peer.&lt;/p&gt;
&lt;p&gt;What happens on the&amp;nbsp;GAP central is unknown (not nordic implementation).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How are CTS (0x1805) services discovered when acting as a GATT Server with an ESP32 GATT Client</title><link>https://devzone.nordicsemi.com/thread/277383?ContentTypeID=1</link><pubDate>Wed, 28 Oct 2020 12:19:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50da02c9-cbe9-4d67-b095-88ff60e250e6</guid><dc:creator>an-erd</dc:creator><description>&lt;p&gt;Ok, understood so far.&lt;/p&gt;
&lt;p&gt;So for question 1) the existing communication will be used.&lt;/p&gt;
&lt;p&gt;and for question 2) there will be both, a GATT server and a GATT client on the GAP central role.&lt;/p&gt;
&lt;p&gt;Although on the GAP central role the GATT server is connected (Evt 14), I don&amp;#39;t see any requests for the CTS service (so a 0x1805)?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What should I see on the GAP central GATT server?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How are CTS (0x1805) services discovered when acting as a GATT Server with an ESP32 GATT Client</title><link>https://devzone.nordicsemi.com/thread/277352?ContentTypeID=1</link><pubDate>Wed, 28 Oct 2020 10:38:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcaeb797-85a1-45c6-a09c-c0554cad4ded</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Just to make sure the naming is consistent:&lt;/p&gt;
&lt;p&gt;The esp32 operate in the GAP central role, while the nRF52 here&amp;nbsp;is the GAP peripheral role. It is the central that can scan and initiate a connection with&amp;nbsp;a peripheral. The GAP role does not change, and the GAP role is independent of GATT. GATT is the layer where data are actually transferred.&lt;/p&gt;
&lt;p&gt;In your case the nRF52 at least is a GATT client for the CTS (though it may also have a GATT server), the esp32 is GATT server for the CTS (though it may also be GATT client for services and characteristics on the peer for other BLE profiles).&lt;/p&gt;
&lt;p&gt;If you want to understand how the CTS works, you would need to check the BT SIG profile for the CTS. You can find a description in our nRF5 SDK how our examples works (though you can change and modify this as you best see fit):&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_cts_c.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_cts_c.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How are CTS (0x1805) services discovered when acting as a GATT Server with an ESP32 GATT Client</title><link>https://devzone.nordicsemi.com/thread/277326?ContentTypeID=1</link><pubDate>Wed, 28 Oct 2020 09:59:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c537df17-df89-4bc2-ab73-ffe89c7070be</guid><dc:creator>an-erd</dc:creator><description>&lt;p&gt;Let me give some more information on my question:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Peripheral&lt;/strong&gt;: sensor beacon based on nrf52832, collecting sensor data, advertising, connectable&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Central&lt;/strong&gt;: esp32 based, reading the advertisements of the peripheral, connects to the sensor to get long-term data as a bulk download&lt;/p&gt;
&lt;p&gt;Only the esp32&amp;nbsp;connects to the beacon but not vice versa. In this case, the esp32 is the &lt;strong&gt;client&lt;/strong&gt;, and the beacon the &lt;strong&gt;server&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As soon as the esp is connected to the beacon, the beacon uses CTS (current time service), now acting as a &lt;strong&gt;client&lt;/strong&gt;, to ask the counterpart, which is the esp, which is now acting as a &lt;strong&gt;server (*)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;d now figure out how this is achieved. As soon as the central is connected to the peripheral with all security done, what happens next:&lt;/p&gt;
&lt;p&gt;Question1) is the existing connection used for the vice verse communication as stated in (*), or will there be another connection?&lt;/p&gt;
&lt;p&gt;Question 2) on the esp32 side, there are now a GATT Client (getting sensor data from beacon) and a GATT Server (serving the time the CTS (current time service client) asks for?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How are CTS (0x1805) services discovered when acting as a GATT Server with an ESP32 GATT Client</title><link>https://devzone.nordicsemi.com/thread/277293?ContentTypeID=1</link><pubDate>Wed, 28 Oct 2020 08:00:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b99713b-fb4e-413f-8ad9-6337560faf2e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The GATT client should do a database discovery of the GATT server, after the database discovery the GATT client can write and read the characteristic values it may want to. Typically if any of the characteristics in the GATT server require security to read and write, then this will also trigger a bonding procedure in parallel.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>