<?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>How to reject/disconnect peer (smartphone) which tried to write huge data to service?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81837/how-to-reject-disconnect-peer-smartphone-which-tried-to-write-huge-data-to-service</link><description>How to reject/disconnect peer (smartphone) which tried to write huge data to service? For now in my project (based on ble_app_multperipheral project from SDK) if the smartphone is try to send more than 20 bytes - the connection is just frozen till GATT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Nov 2021 14:54:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81837/how-to-reject-disconnect-peer-smartphone-which-tried-to-write-huge-data-to-service" /><item><title>RE: How to reject/disconnect peer (smartphone) which tried to write huge data to service?</title><link>https://devzone.nordicsemi.com/thread/339861?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 14:54:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f65ba6ee-478c-47db-92c2-e4f4affca2fb</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;If you don&amp;#39;t have QWR module you will not be able to handle write requests from the Softdevice, such as BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST if the client starts a queued write request, and this will soon or later result in timeout. You don&amp;#39;t need to support long writes, but you should be able to handle the requests from the Softdevice.&lt;/p&gt;
&lt;p&gt;You can try to increase the MTU_SIZE up to 247 so you can handle when the smartphone sends data with more than 37 bytes length.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reject/disconnect peer (smartphone) which tried to write huge data to service?</title><link>https://devzone.nordicsemi.com/thread/339642?ContentTypeID=1</link><pubDate>Thu, 18 Nov 2021 12:52:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3008c5da-e0e4-449e-8548-090d2fae0c3c</guid><dc:creator>Arthur_Melkumov</dc:creator><description>&lt;p&gt;Hmmm. I thought that the QWR module is one of the ways to write a big amount of data (more than 20 bytes) but not the only one.&lt;br /&gt;And for now, in my code, I don&amp;#39;t initialize this module and just by changing the NRF_SDH_BLE_GATT_MAX_MTU_SIZE from 23 to e.g. 40, I get the ability to write data more than 20 bytes (up to 37 bytes). And with that configuration, if the smartphone sends data of length &amp;lt;=37 bytes - nRF receives it and can operate this data. But if the smartphone sends data which length is more than 37 bytes - the connection freezes.&lt;br /&gt;So to understand you clearly - the reason of such freezings is just not initialized QWR module? But when I write more than 20 bytes without initializing it and it works - why? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reject/disconnect peer (smartphone) which tried to write huge data to service?</title><link>https://devzone.nordicsemi.com/thread/339635?ContentTypeID=1</link><pubDate>Thu, 18 Nov 2021 12:38:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dd1a8b8-0c7e-4acc-aecc-818ded2f6d0e</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What is your MTU size? The default MTU size in the ble_app_multiperipheral example is 23 bytes, with 3 bytes for the ATT header it leaves you with 20 bytes payload.&lt;/p&gt;
&lt;p&gt;Perhaps the smartphone is using &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_ble_queued_write.html"&gt;Queue Writes&lt;/a&gt; in order to send a characteristic longer than 20 bytes, splitting the writing operation into more than a single packet. In that case you can get a GATT CONN timeout if the queue writes are not handle correctly by the peripheral. Have you modified the ble_app_multiperipheral example in some way? Perhaps try to check if&amp;nbsp; you are still initializing the QWR module, in the out-of-the-box example this module is initialized in the LED button service.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>