<?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>Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95780/modification-of-the-thread-message-header</link><description>Hello 
 In my project, I am using the Thread network. I can communicate with all the devices on the network but there is a particular case that I don&amp;#39;t know how to solve. 
 I have device &amp;#39;1&amp;#39; sending a confirmable message to device &amp;#39;2&amp;#39;. To resolve this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Feb 2023 10:22:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95780/modification-of-the-thread-message-header" /><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/409796?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2023 10:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:799bf3a0-d616-4667-b470-af608526082d</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;No you can close.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/409788?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2023 09:59:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf82c4d4-39e6-4814-b063-e5be17233ba2</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Can we close this case then, or are there any follow-up questions from your end?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/409609?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 13:30:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f155c94-8afc-47b8-a969-08aad1abcf8c</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Thank you very much !&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/409268?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2023 07:11:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8167577a-a56a-45e3-ac57-a4c203679cb1</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Finally we have a thorough answer for your Quentin:&lt;/p&gt;
&lt;p&gt;The proper flow of a separate response in CoAP for an application can be as follows (based on&amp;nbsp;&lt;a href="https://www.rfc-editor.org/rfc/rfc7252#section-5.2.2):"&gt;https://www.rfc-editor.org/rfc/rfc7252#section-5.2.2&lt;/a&gt;). This is also what we recommend:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Obtain token from received request&lt;/li&gt;
&lt;li&gt;Create new message&lt;/li&gt;
&lt;li&gt;Initialize message as ACK response with an empty message code. Use a function to set the same Message ID as in the request. According to the below code brief this also sets the same token, although that shouldn&amp;#39;t matter when the initialized ACK response is empty.&lt;/li&gt;
&lt;li&gt;Send ACK as a response to request (message ID is matching the request).&lt;/li&gt;
&lt;li&gt;Process the proper response&lt;/li&gt;
&lt;li&gt;Create new message&lt;/li&gt;
&lt;li&gt;Set message token to be the same as obtained from the request&lt;/li&gt;
&lt;li&gt;Add payload to the message if necessary&lt;/li&gt;
&lt;li&gt;Initialize the message, this time not as a response. It should be of type CON or NON with the proper code&lt;/li&gt;
&lt;li&gt;Send a message as a new request (where the token is matching the request).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some more information about the flow and a helpful illustration showing how the token and message ID should match can be found here:&amp;nbsp;&lt;a href="https://www.rfc-editor.org/rfc/rfc7252#section-2.2"&gt;https://www.rfc-editor.org/rfc/rfc7252#section-2.2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;From client&amp;#39;s side, the client should send the request, and after receiving an empty acknowledgement message, wait for new request message from server with a matching token.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is some pseudocode showing an example that only covers the most important points (the rest must be implemented according to your application&amp;#39;s needs:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void processLongerResponse(otMessage *request, otMessageInfo *message_info)
{
        const uint8_t *token = otCoapMessageGetToken(request);
        uint8_t tokenLen = otCoapMessageGetTokenLength(request);
 
        otMessage *response1 = NULL;
 
        response1 = otCoapNewMessage(instancePtr, NULL);
 
        otCoapMessageInitResponse(response1, request, OT_COAP_TYPE_ACKNOWLEDGMENT, OT_COAP_CODE_EMPTY);
 
        // send ACK as response, for example using otCoapSendResponse(). hint: use message_info
 
        // process proper response
 
        otMessage *response2 = NULL;
 
        response2 = otCoapNewMessage(instancePtr, NULL);
 
        otCoapMessageSetToken(response2, token, tokenLen);
        // add payload to respone2 if needed
 
        otCoapMessageInit(response2, OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_VALID);
 
        // send as request, for example using otCoapSendRequest(). hint: usemessage_info
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/408900?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 14:02:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20450d26-b952-4e15-9083-e8d289205a6f</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Ok &lt;br /&gt;Thank you for your follow up&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/408892?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 13:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:addfd27d-a48f-423c-bc82-b4bd1bfb3b09</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;I&amp;#39;m very sorry about the delay, but I wanted to let you know that we&amp;#39;re still looking into this. It has taken longer than anticipated to get to the bottom of this and find a satisfactory reply for you.&lt;/p&gt;
&lt;p&gt;Again, thank you for your patience!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/406798?ContentTypeID=1</link><pubDate>Fri, 27 Jan 2023 09:01:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aea3b6f2-a474-42a3-b341-fb88288e690b</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Ok thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/406786?ContentTypeID=1</link><pubDate>Fri, 27 Jan 2023 08:18:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d93893c6-ca83-4ae0-a5c6-2073f3e763ff</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again Quentin&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry about the delayed response, but I haven&amp;#39;t heard back from the developers on this yet, and have bumped the internal ticket again. I&amp;#39;ll get back to you as soon as I hear from you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/405805?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2023 10:26:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e35bf2d-57de-432e-8afa-5f24d16c7344</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Hello&lt;br /&gt;&lt;br /&gt;I&amp;nbsp;use&amp;nbsp;nRF5 SDK for Thread and Zigbee.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Yes I know I could try to find an alternative to solve the problem but as it seems to me that the protocol allows to do it like that, I wanted to know if your SDK allowed it too.&lt;br /&gt;What did your experts say?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/405797?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2023 09:52:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcd42460-8f35-4378-a36e-feebd5d30e21</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Quentin&lt;/p&gt;
&lt;p&gt;Okay, so since you use SEGGER, I assume you&amp;#39;re using the &lt;a href="https://infocenter.nordicsemi.com/topic/struct_sdk/struct/sdk_thread_zigbee_latest.html"&gt;nRF5 SDK for Thread and Zigbee&lt;/a&gt;? Or are you using the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html"&gt;nRF Connect SDK&lt;/a&gt;? You might need to send a confirmable request, that is ACKed to start processing, and then send a new request when you expect the processing to be complete.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/405613?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 09:12:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6efdf7e0-30eb-4ae8-9057-7c15ab7f522a</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Hello&lt;br /&gt;&lt;br /&gt;I use SEGGER Embedded Studio for ARM V5.60a&lt;br /&gt;&lt;br /&gt;The duration of time to respond to the message is variable but we are talking here about several seconds minimum (when device &amp;#39;2&amp;#39; receives the request, it must query several other devices on the network in order to retrieve information).&lt;br /&gt;&lt;br /&gt;Just for your information on how the CoAP protocol works, I advise you to read pages 33 to 35 of the documentation (&lt;a href="https://www.rfc-editor.org/rfc/rfc7252#section-5.2.1)."&gt;www.rfc-editor.org/.../rfc7252&lt;/a&gt;&amp;nbsp;)&lt;br /&gt;When a device &amp;#39;1&amp;#39; sends a confirmable message to a device &amp;#39;2&amp;#39;, this message must be acknowledged with the same message ID so that the device &amp;#39;1&amp;#39; does not automatically retransmit this message: it is why I have to quickly acknowledge the confirmable message in order to have a&amp;nbsp;multiple messages retransmissions.&lt;br /&gt;When we send a confirmable message to retrieve information (GET), we add a token in this message so that we can identify that the message received (containing this same token) is the response to a message we sent.&lt;br /&gt;&lt;br /&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modification of the Thread message header</title><link>https://devzone.nordicsemi.com/thread/405602?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 08:16:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:980342aa-8e66-43d7-a225-6602fd37fae2</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Quentin&lt;/p&gt;
&lt;p&gt;Sorry about the late response but I have to ask internally to get a good answer. I&amp;#39;m still waiting for a reply from our experts, but in the meantime. Can you add some details on what SDK and SDK version are you using for development? What exactly is it that takes time to resolve with your confirmable message, and how much time are we talking about here?&lt;/p&gt;
&lt;p&gt;As an update from what I&amp;#39;ve been able to find. I&amp;#39;m not so sure you can split up the token and message ID, but rather send the confirmation message with the same ID as the ACK. I still need to hear from the experts to confirm whether this is the case though.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>