<?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>ANCS with MTU &amp;gt; 23</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23553/ancs-with-mtu-23</link><description>I tried to set up the ANCS example. It works fine. But how is it possible to set a higher MTU. I set the NRF_BLE_GATT_MAX_MTU_SIZE to 247. But the Log says after a connect: 
 nrf_ble_gatt:DEBUG:Requesting to update ATT MTU to 247 bytes on connection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Apr 2018 12:25:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23553/ancs-with-mtu-23" /><item><title>RE: ANCS with MTU &gt; 23</title><link>https://devzone.nordicsemi.com/thread/126518?ContentTypeID=1</link><pubDate>Mon, 02 Apr 2018 12:25:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f34a89a-3f48-4829-a0b4-18bed4f635c2</guid><dc:creator>tberset</dc:creator><description>&lt;p&gt;Thanks, this helped me with the same problem!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS with MTU &gt; 23</title><link>https://devzone.nordicsemi.com/thread/92522?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2017 09:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b5f6e22-4f49-44aa-a30c-ff329f4fb989</guid><dc:creator>gotthcha</dc:creator><description>&lt;p&gt;Okay i got a fix. @Coldson on my ios 10 i can reach a MTU of 247 Bytes:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;pre&amp;gt;
nrf_ble_gatt:DEBUG:Requesting to update ATT MTU to 247 bytes on connection 0x0.
 0&amp;gt; nrf_ble_gatt:DEBUG:Requesting to update data length to 251 on connection 0x0.
 0&amp;gt; nrf_ble_gatt:DEBUG:Data length updated to 251 on connection 0x0.
 0&amp;gt; nrf_ble_gatt:DEBUG:max_rx_octets: 251
 0&amp;gt; nrf_ble_gatt:DEBUG:max_tx_octets: 251
 0&amp;gt; nrf_ble_gatt:DEBUG:max_rx_time: 2120
 0&amp;gt; nrf_ble_gatt:DEBUG:max_tx_time: 2120
 0&amp;gt; nrf_ble_gatt:DEBUG:ATT MTU updated to 247 bytes on connection 0x0 (response).
 0&amp;gt; :INFO:GATT ATT MTU on connection 0x0 changed to 247.
 0&amp;gt; nrf_ble_gatt:DEBUG:Peer on connection 0x0 requested a data length of 251 bytes.
 0&amp;gt; nrf_ble_gatt:DEBUG:Updating data length to 251 bytes on connection 0x0.
 0&amp;gt; nrf_ble_gatt:DEBUG:Data length updated to 251 on connection 0x0.
 0&amp;gt; nrf_ble_gatt:DEBUG:max_rx_octets: 251
 0&amp;gt; nrf_ble_gatt:DEBUG:max_tx_octets: 251
 0&amp;gt; nrf_ble_gatt:DEBUG:max_rx_time: 2120
 0&amp;gt; nrf_ble_gatt:DEBUG:max_tx_time: 2120
 0&amp;gt; :INFO:Connection secured: role: 1, conn_handle: 0x0, procedure: 1.
&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;U need to change the BLE-Stack part to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;pre&amp;gt;
// Configure the maximum number of connections.
	memset(&amp;amp;ble_cfg, 0, sizeof(ble_cfg));
	ble_cfg.gap_cfg.role_count_cfg.periph_role_count  = 1;
	ble_cfg.gap_cfg.role_count_cfg.central_role_count = 0;
	ble_cfg.gap_cfg.role_count_cfg.central_sec_count  = 0;
	err_code = sd_ble_cfg_set(BLE_GAP_CFG_ROLE_COUNT, &amp;amp;ble_cfg, ram_start);
	APP_ERROR_CHECK(err_code);

    // Configure the maximum ATT MTU.
   memset(&amp;amp;ble_cfg, 0x00, sizeof(ble_cfg));
   ble_cfg.conn_cfg.conn_cfg_tag                 = CONN_CFG_TAG;
   ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = NRF_BLE_GATT_MAX_MTU_SIZE;
   err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATT, &amp;amp;ble_cfg, ram_start);
   APP_ERROR_CHECK(err_code);

   // Configure the maximum event length.
   memset(&amp;amp;ble_cfg, 0x00, sizeof(ble_cfg));
   ble_cfg.conn_cfg.conn_cfg_tag                     = CONN_CFG_TAG;
   ble_cfg.conn_cfg.params.gap_conn_cfg.event_length = 320;
   ble_cfg.conn_cfg.params.gap_conn_cfg.conn_count   = BLE_GAP_CONN_COUNT_DEFAULT;
   err_code = sd_ble_cfg_set(BLE_CONN_CFG_GAP, &amp;amp;ble_cfg, ram_start);
   APP_ERROR_CHECK(err_code);
&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;the GATT Init part to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;pre&amp;gt;
err_code = nrf_ble_gatt_att_mtu_periph_set(&amp;amp;m_gatt, NRF_BLE_GATT_MAX_MTU_SIZE);
	APP_ERROR_CHECK(err_code);

	uint8_t data_length = ((uint8_t)NRF_BLE_GATT_MAX_MTU_SIZE + 4);
	nrf_ble_gatt_data_length_set(&amp;amp;m_gatt, BLE_CONN_HANDLE_INVALID, data_length);

	ble_opt_t opt;

	memset(&amp;amp;opt, 0x00, sizeof(opt));
	opt.common_opt.conn_evt_ext.enable = 1;

	err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &amp;amp;opt);
	APP_ERROR_CHECK(err_code);

	NRF_LOG_DEBUG(&amp;quot;Setting connection event length extension to %u: 0x%x\r\n&amp;quot;, 1, err_code);
&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and add this part to advertise init part (on the end):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;pre&amp;gt;
ble_advertising_conn_cfg_tag_set(CONN_CFG_TAG);
&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS with MTU &gt; 23</title><link>https://devzone.nordicsemi.com/thread/92521?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2017 02:09:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7140d6fb-63ae-439a-af06-359ecabbe9f7</guid><dc:creator>Coldson</dc:creator><description>&lt;p&gt;@gotthcha&lt;/p&gt;
&lt;p&gt;I have try to modify MTU size before, but on CSR and BRCM platform.&lt;/p&gt;
&lt;p&gt;And I have a question for u, which version u r current using? iOS 10?&lt;/p&gt;
&lt;p&gt;As I remember, when in iOS 7 MTU size on the iPhone can only up to 128 byte&lt;/p&gt;
&lt;p&gt;iOS 8 MTU size 135, iOS 9 MTU size 158, iOS 10 MTU size is 185 byte,&lt;/p&gt;
&lt;p&gt;This image below is the nRF52832 connect with iOS 9,&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/mtu-ios9.jpg" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;Can U just using 185 byte or less, and give it a try?&lt;/p&gt;
&lt;p&gt;BTW: &amp;quot;Invalid Parameter&amp;quot; is the error code 0x07 u got.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define 	NRF_ERROR_INVALID_PARAM   (NRF_ERROR_BASE_NUM + 7)
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>