<?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>Detect MTU and Interval during connection?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36804/detect-mtu-and-interval-during-connection</link><description>Is there an easy way to check what the current connection&amp;#39;s agreed upon MTU is? 
 I&amp;#39;m connecting to random devices that all have different intervals and MTUs. I can&amp;#39;t be sure that this device supports more than 20 byte read/writes, but so I&amp;#39;d like to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Jul 2018 08:48:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36804/detect-mtu-and-interval-during-connection" /><item><title>RE: Detect MTU and Interval during connection?</title><link>https://devzone.nordicsemi.com/thread/141850?ContentTypeID=1</link><pubDate>Mon, 30 Jul 2018 08:48:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc729cdc-7b1c-4878-9a3a-dedccbb50b90</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;The GATT module has the&amp;nbsp;&lt;span&gt;nrf_ble_gatt_link_t -struct. And a getter function&amp;nbsp;nrf_ble_gatt_eff_mtu_get().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you are already using the gatt module, I&amp;#39;d assume this would be the way to get the MTU size rather than assuming or having the application also keep track of update events.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detect MTU and Interval during connection?</title><link>https://devzone.nordicsemi.com/thread/141836?ContentTypeID=1</link><pubDate>Mon, 30 Jul 2018 07:50:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7860d50-e4f4-44af-8f21-a55f00951362</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;You&amp;#39;re right. The MTU is 23 (20 bytes of user-data) by default, unless the ATT_MTU is updated on-air.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detect MTU and Interval during connection?</title><link>https://devzone.nordicsemi.com/thread/141758?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2018 20:15:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da29874c-8287-4d8c-a738-12998e4cf961</guid><dc:creator>SRA</dc:creator><description>&lt;p&gt;H&amp;aring;kon, great, that works if there is a re-negotiation but we&amp;#39;re still not clear on how to pick up the MTU at initial connection... or is it always default (20ish) and has to run through the update to make it longer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detect MTU and Interval during connection?</title><link>https://devzone.nordicsemi.com/thread/141673?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2018 12:18:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64fc6f78-9179-481e-aee6-6bc3c6c38725</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;In example ble_app_hrs (and many others), this is reported via the nrf_ble_gatt module:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief GATT module event handler.
 */
static void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)
{
    if (p_evt-&amp;gt;evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED)
    {
        NRF_LOG_INFO(&amp;quot;GATT ATT MTU on connection 0x%x changed to %d.&amp;quot;,
                     p_evt-&amp;gt;conn_handle,
                     p_evt-&amp;gt;params.att_mtu_effective);
    }

    ble_hrs_on_gatt_evt(&amp;amp;m_hrs, p_evt);
}


/**@brief Function for initializing the GATT module.
 */
static void gatt_init(void)
{
    ret_code_t err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, gatt_evt_handler);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detect MTU and Interval during connection?</title><link>https://devzone.nordicsemi.com/thread/141412?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 17:09:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:249f7b39-4866-47ce-b79f-3216e4cc0698</guid><dc:creator>SRA</dc:creator><description>&lt;p&gt;Would you mind showing WHERE they are available? &amp;quot;In the event&amp;quot; doesn&amp;#39;t entirely point me to the structure they are available in. Any example code by chance?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detect MTU and Interval during connection?</title><link>https://devzone.nordicsemi.com/thread/141231?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 02:05:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d613d18-8e7b-48a5-af22-b6f8ba4b668c</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;and the other connection parameters are in the original connection event and the connection parameter update events.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detect MTU and Interval during connection?</title><link>https://devzone.nordicsemi.com/thread/141229?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 01:39:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c246c057-4a35-482b-ad01-1372c10ecead</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;All these&amp;nbsp;data length parameters come in the BLE_GAP_EVENT_DATA_LENGTH_UPDATE events. You can start by assuming any connection has the default and then, if you get one of those events after the procedure has been performed, update the value.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>