<?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>SD7 send one packet per interval</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75607/sd7-send-one-packet-per-interval</link><description>I am using SD7 and I want to send exactly one 23-byte notification per connection interval. If I wait for the BLE_GATTS_EVT_HVN_TX_COMPLETE event and call sd_ble_gatts_hvx() then it is sending one notification every other interval. How do I send one per</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 May 2021 18:09:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75607/sd7-send-one-packet-per-interval" /><item><title>RE: SD7 send one packet per interval</title><link>https://devzone.nordicsemi.com/thread/312208?ContentTypeID=1</link><pubDate>Thu, 27 May 2021 18:09:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55eaf41e-d4e6-4162-96ec-06509e183c2b</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;An alterative&amp;nbsp;could be to use Radio Notifications:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/radio_notif/radio_notif_peripheral_events.html"&gt;https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/radio_notif/radio_notif_peripheral_events.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v4.0.2%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=gac2dc8aae2c68a2afa1a77340ad59d789"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v4.0.2%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=gac2dc8aae2c68a2afa1a77340ad59d789&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See SDK_folder\components\ble\ble_radio_notification\ble_radio_notification.c for an example on how to use this API.&lt;/p&gt;
&lt;p&gt;But note this limitation mentioned in SD release notes: &amp;quot;If Radio Notifications are enabled, flash write and flash erase operations initiated through the SoftDevice API will be notified to the application as Radio Events&amp;quot;, so some added sanity testing might need to be added, i.e. check with an timer(RTC-based) how long time it was since last notification was called, and compare that with the connection interval, and/or set a flag before/after you do any flash operations, and ignore events if the flag is set.&lt;/p&gt;
&lt;p&gt;Alternatively, a very simple approach would be to just start a RTC timer with a timeout that equals the connection interval, and in the timeout call&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx(), but without any &amp;quot;sync signal&amp;quot;&amp;nbsp;from the SD, there might be some drift over time, so that at some point, you might perhaps send 0, or 2 notifications in a connection event.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD7 send one packet per interval</title><link>https://devzone.nordicsemi.com/thread/311908?ContentTypeID=1</link><pubDate>Wed, 26 May 2021 20:15:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:495d1e21-b485-455c-bcb4-1923b3f962b3</guid><dc:creator>jeffdev3</dc:creator><description>&lt;p&gt;Thank you.&amp;nbsp; I can get it to work using SD7.&amp;nbsp; Is there a way to do it without using&amp;nbsp;sd_ble_gap_conn_evt_trigger_start()?&amp;nbsp; I would like to implement it in SD4 which doesn&amp;#39;t have this API.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD7 send one packet per interval</title><link>https://devzone.nordicsemi.com/thread/311840?ContentTypeID=1</link><pubDate>Wed, 26 May 2021 13:52:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff164083-2183-4c2a-9c51-027297f6d3db</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""] If I wait for the&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE event and call&amp;nbsp;sd_ble_gatts_hvx() then it is sending one notification every other interval.[/quote]
&lt;p&gt;&amp;nbsp;This makes sense,&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE occurs when a notification is acked on the link layer. So this usually requires 2 connection event. First one is for the peripheral to send the packet and the next one is when the packet ACKed by the central.&amp;nbsp;&lt;/p&gt;
[quote user=""]How do I send one per interval?[/quote]
&lt;p&gt;You could use &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v7.2.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga6a2d8c4cd863ac538eb0a51d594e0dd6"&gt;sd_ble_gap_conn_evt_trigger_start&lt;/a&gt;&amp;nbsp;, and make it trigger a software interrupt every connection event start. (use the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/egu.html?cp=4_2_0_45#concept_x4j_fx1_lr"&gt;EGU&lt;/a&gt;), and in the SW interrupt call&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx().&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>