<?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>nRF connect app actively requested mtu negotiation failed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60643/nrf-connect-app-actively-requested-mtu-negotiation-failed</link><description>Based on 52832, sdk15.3 running ble_app_hrs example, requesting MTU through nRF connect, the first success, the second time is unsuccessful, the app prompts Error 4 (0x4): GATT INVALID PDU 
 Device prompt: NRF_ERROR_INVALID_STATE 
 
 I did not make any</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Apr 2020 06:41:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60643/nrf-connect-app-actively-requested-mtu-negotiation-failed" /><item><title>RE: nRF connect app actively requested mtu negotiation failed</title><link>https://devzone.nordicsemi.com/thread/247211?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 06:41:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f0d52f3-366c-4aaa-a7dc-da93f4a0e7af</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="zero"]After Bluetooth connection, can my app request mtu negotiation again?[/quote]
&lt;p&gt;No, the request shall only be sent once during a connection by the client. If&amp;nbsp;you do sd_ble_gattc_exchange_mtu_request() again, in the same connection, you will get NRF_ERROR_INVALID_STATE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I recommend to call nrf_ble_gatt_att_mtu_periph_set() before or right after&amp;nbsp;you disconnect.&amp;nbsp;You can still call &lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrf__ble__gatt.html#ga4fd7e5c4607cba63f00b8bf9711c3ca3"&gt;nrf_ble_gatt_att_mtu_periph_set&lt;/a&gt;() to set the desired MTU while in the connection, but it won&amp;#39;t have any effect before the next connection.&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF connect app actively requested mtu negotiation failed</title><link>https://devzone.nordicsemi.com/thread/246639?ContentTypeID=1</link><pubDate>Sun, 26 Apr 2020 01:47:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d51cde9-b699-4241-b0b4-a8af0674a6e4</guid><dc:creator>zero</dc:creator><description>&lt;p&gt;Hi，&lt;/p&gt;
&lt;p&gt;After Bluetooth connection, can my app request mtu negotiation again?&lt;br /&gt;Not Exchange MTU.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF connect app actively requested mtu negotiation failed</title><link>https://devzone.nordicsemi.com/thread/246520?ContentTypeID=1</link><pubDate>Fri, 24 Apr 2020 12:33:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a559aa8-11ef-4175-90b2-df3939611213</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding the MTU exchange request resulting in &amp;quot;Error 4 (0x4): GATT INVALID PDU&amp;quot;: this behavior is expected&amp;nbsp;according to the Bluetooth specification. According to the spec, MTU request shall only be sent once during a connection:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;3.4.2.1 Exchange MTU Request (&lt;/em&gt;Blueooth Core Specification v.5.0.0, vol 3, Part F&lt;em&gt;)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;The Exchange MTU Request is used by the client to inform the server of the&lt;/em&gt;&lt;br /&gt;&lt;em&gt;client’s maximum receive MTU size and request the server to respond with its&lt;/em&gt;&lt;br /&gt;&lt;em&gt;maximum receive MTU size.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;The Client Rx MTU shall be greater than or equal to the default ATT_MTU.&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;This request shall only be sent once during a connection by the client. The&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Client Rx MTU parameter shall be set to the maximum size of the attribute&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;protocol PDU that the client can receive.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To set a new maximum MTU size, use&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrf__ble__gatt.html#ga4fd7e5c4607cba63f00b8bf9711c3ca3"&gt;nrf_ble_gatt_att_mtu_periph_set&lt;/a&gt;&lt;span&gt;&amp;nbsp;for peripheral devices and&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrf__ble__gatt.html#gace7ab5e35085556648b816bf1828a070"&gt;nrf_ble_gatt_att_mtu_central_set&lt;/a&gt;&lt;span&gt;&amp;nbsp;for central devices. The new ATT_MTU value is a static value; it must be set before the connection is established. Please see the&amp;nbsp;&lt;a title="Experimental: GATT Module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_ble_gatt.html?cp=7_1_3_2_13"&gt;GATT Module&lt;/a&gt;&amp;nbsp;documentation.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>