<?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>Manage a response timeout (CoAP Thread)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68543/manage-a-response-timeout-coap-thread</link><description>Hello, I have an application based on the example &amp;quot;ble_thread_dyn_mtd_coap_cli_pca10056_s140&amp;quot;. 
 When a confirmable message has not received a response, I receive the error (OT_ERROR_RESPONSE_TIMEOUT) in the response handler. 
 Here are my questions:</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Nov 2020 16:09:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68543/manage-a-response-timeout-coap-thread" /><item><title>RE: Manage a response timeout (CoAP Thread)</title><link>https://devzone.nordicsemi.com/thread/280962?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2020 16:09:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97d75e12-4315-4a6c-bdbc-c0fd03302824</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]- How can we know which message this timeout corresponds to? [/quote]
&lt;p&gt;You can use the p_context parameter to pass any variable notifying your own application about the message type that caused the response. The context parameter is input to the last argument to&amp;nbsp;otCoapSendRequest().&lt;/p&gt;
[quote user=""]Do we still have access to the send buffer at this time?[/quote]
&lt;p&gt;No, the message is freed right before the handler is called, see &lt;a href="https://github.com/openthread/openthread/blob/c6a258e3a5bd90aa26d8245c435c0ae5797027f4/src/core/coap/coap.cpp#L400"&gt;this function&lt;/a&gt;.&lt;/p&gt;
[quote user=""]- How can we reduce the time needed before having a timeout?[/quote]
&lt;p&gt;The ACK timeout and re-transmit numbers can be set in&amp;nbsp;&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/structot_coap_tx_parameters.html"&gt;otCoapTxParameters&lt;/a&gt;. You can then pass this parameter to&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/group__api-coap.html#gace3de6a217f540d8fe26bbf7834400e3"&gt;otCoapSendRequestWithParameters&lt;/a&gt;().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>