<?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>Proper sequence to disconnect BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112330/proper-sequence-to-disconnect-ble</link><description>Hi Nordic team, 
 I&amp;#39;m using nRF52832, S132 with nRF5_SDK_17.1.0_ddde560 SDK. I want to send a packet with a notification to my smartphone and then disconnect immediately. I have implemented write notify and disconnect commands successfully. However, I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Jun 2024 08:52:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112330/proper-sequence-to-disconnect-ble" /><item><title>RE: Proper sequence to disconnect BLE</title><link>https://devzone.nordicsemi.com/thread/491251?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2024 08:52:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37d46bc0-cfe5-4c4a-a642-ad7e128d8a43</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Xander,&lt;/p&gt;
[quote user="Xander To"]I have checked out the link you sent. I believe that writing with the response is the property required to ensure no data loss when a smartphone wants to send data to the MCU, and reading with indication is the property required to ensure no data loss when the MCU sends data to a smartphone, am I correct?[/quote]
&lt;p&gt;Yes&lt;/p&gt;
[quote user="Xander To"]Furthermore, if I want a smartphone or any client-side to read the data from MCU without polling, I must add notify properties to the characteristic. So in the end, I must use read notify indication characteristic?[/quote]
&lt;p&gt;Indication also let the client read without polling. It&amp;nbsp;just requires a response from the client in&amp;nbsp;the next connection event and is therefore slower than Notification.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to disconnect BLE</title><link>https://devzone.nordicsemi.com/thread/491202?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2024 01:31:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a68b27e-a1e9-4ecd-bfb2-f39d85301d04</guid><dc:creator>Xander To</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;I have checked out the link you sent. I believe that writing with the response is the property required to ensure no data loss when a smartphone wants to send data to the MCU, and reading with indication is the property required to ensure no data loss when the MCU sends data to a smartphone, am I correct?&lt;/p&gt;
&lt;p&gt;Furthermore, if I want a smartphone or any client-side to read the data from MCU without polling, I must add notify properties to the characteristic. So in the end, I must use read notify indication characteristic?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Xander&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to disconnect BLE</title><link>https://devzone.nordicsemi.com/thread/490871?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 12:21:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0531788a-bf16-4ab0-8ef3-cec12dc45aca</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Xander,&lt;/p&gt;
&lt;p&gt;Central and Peripheral are GAP concepts. When you are dealing with characteristics, you are dealing with GATT, and the roles are GATT Client and GATT Server.&lt;/p&gt;
&lt;p&gt;In the vast majority of cases, the smartphone is the GAP Central and also the GATT Client, and a BLE device is the GAP Peripheral&amp;nbsp;and also the GATT Server.&lt;/p&gt;
[quote user="Xander To"]1. If I want to send data from a smartphone to the MCU, and I want the write with the response to ensure the write command goes through successfully, the MCU must have a write with response characteristic &lt;span&gt;properties&lt;/span&gt;?[/quote]
&lt;p&gt;Almost yes. To be precise, the characteristic being written must have the Write with Response properties.&lt;/p&gt;
[quote user="Xander To"]2. If I want to send data from MCU to the smartphone, and ensure no data loss,&amp;nbsp;the MCU must have a read indication characteristic properties? Smartphones don&amp;#39;t have to poll data so that&amp;#39;s why I used to read notify in the past. I&amp;#39;m not sure if I can replace read notify with just read indication.[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Read, Notify, and Indicate are three different &lt;em&gt;independent&lt;/em&gt; properties. Independent meaning they are not in any way mutually exclusive or implicative.&lt;br /&gt;They should be set according&amp;nbsp;to&amp;nbsp;what you want to enable and what you want to forbid.&lt;/p&gt;
[quote user="Xander To"]If possible, can you guide me with some resources to learn how to use these properties properly?[/quote]
&lt;p&gt;This is pretty good:&amp;nbsp;&lt;a href="https://novelbits.io/bluetooth-gatt-services-characteristics/"&gt;https://novelbits.io/bluetooth-gatt-services-characteristics/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to disconnect BLE</title><link>https://devzone.nordicsemi.com/thread/490717?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2024 20:05:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2904a7fe-ed9b-4817-8e44-267e4d227d2e</guid><dc:creator>Xander To</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;After doing more research about indication and notification, I&amp;#39;m getting more confused now. I&amp;#39;m not sure if I misunderstood anything but here is how I understand. Let&amp;#39;s assume BLE peripheral is NRF MCU, and BLE central is a smartphone.&lt;br /&gt;1. If I want to send data from a smartphone to the MCU, and I want the write with the response to ensure the write command goes through successfully, the MCU must have a write with response characteristic &lt;span&gt;properties&lt;/span&gt;?&lt;br /&gt;2. If I want to send data from MCU to the smartphone, and ensure no data loss,&amp;nbsp;the MCU must have a read indication characteristic properties? Smartphones don&amp;#39;t have to poll data so that&amp;#39;s why I used to read notify in the past. I&amp;#39;m not sure if I can replace read notify with just read indication.&lt;/p&gt;
&lt;p&gt;If possible, can you guide me with some resources to learn how to use these properties properly?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Xander&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to disconnect BLE</title><link>https://devzone.nordicsemi.com/thread/490618?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2024 12:02:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0dbe0b4-cc79-4741-8844-6317d294321b</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Xander,&lt;/p&gt;
&lt;p&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE will be generated when the notification has been sent. You can consider it a reference point to wait for before disconnecting.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to disconnect BLE</title><link>https://devzone.nordicsemi.com/thread/490053?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2024 20:41:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43266142-0ae3-4801-9506-9dc03a96acbf</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Xander,&lt;/p&gt;
&lt;p&gt;I will have to get back to you next week on whether the notification will be sent for sure before the disconnect happen.&lt;/p&gt;
&lt;p&gt;Your other question is rather on topic. If you want to ensure that the data is received by the smartphone, then you can use Indication instead of Notification.&amp;nbsp;If very high throughput is not a concern, this is the best option.&lt;/p&gt;
&lt;p&gt;See:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-different-ble-packet-types-influence-throughpu"&gt;How different BLE packet types influence throughput&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>