<?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>NCP Wpantund, how to customize data sending</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85325/ncp-wpantund-how-to-customize-data-sending</link><description>I use 52833dK,Wpanctl whether there is a command to send custom data in the thread network.Similar to UDP in cli. 
 I found that there are relevant codes of HDLC software flow control in WPANTund and Coprocessor. How do I verify whether this function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Mar 2022 01:43:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85325/ncp-wpantund-how-to-customize-data-sending" /><item><title>RE: NCP Wpantund, how to customize data sending</title><link>https://devzone.nordicsemi.com/thread/358089?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 01:43:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62efc5d0-74a5-47aa-989e-95bb56efd892</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;Hi，&lt;/p&gt;
&lt;p&gt;&lt;span&gt;May I ask, is there any way to add software flow control to NCP? Could you give me some suggestions on software flow control.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Ethan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCP Wpantund, how to customize data sending</title><link>https://devzone.nordicsemi.com/thread/356457?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 01:39:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4166374f-cc60-4180-9639-e331d3db475e</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;&lt;span&gt;I&amp;#39;m sorry I didn&amp;#39;t notice that&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Using the WPAN0 interface, I was able to do some testing on the data transfer&lt;/span&gt;&lt;/p&gt;
&lt;p class="tgt"&gt;&lt;span class="tgt"&gt;With our current hardware design, there is no more RTS/CTS interface on the host side, software flow control is the only option, and I know it has a lot of drawbacks.&lt;/span&gt;&lt;span class="tgt"&gt; Hope to provide some relevant design suggestions.&lt;/span&gt;&lt;/p&gt;
&lt;p class="tgt"&gt;&lt;span class="tgt"&gt;I mean HDLC coding.&lt;/span&gt;&lt;span class="tgt"&gt; I found the code in WPANTund and coprocessor.&lt;/span&gt;&lt;span class="tgt"&gt; I see XOn/ XOff defined.&lt;/span&gt;&lt;span class="tgt"&gt; Is this a reserved feature of software flow control?&lt;/span&gt;&lt;/p&gt;
&lt;p class="tgt"&gt;&lt;span class="tgt"&gt;&lt;span&gt;In the Coprocessor code:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="tgt"&gt;&lt;span class="tgt"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;hdlc.hpp&amp;quot;

enum
{
    kFlagXOn        = 0x11,
    kFlagXOff       = 0x13,
    kFlagSequence   = 0x7e, ///&amp;lt; HDLC Flag value
    kEscapeSequence = 0x7d, ///&amp;lt; HDLC Escape value
    kFlagSpecial    = 0xf8,
};&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="tgt"&gt;&lt;span class="tgt"&gt;&lt;span&gt;In the Wpantund code:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="tgt"&gt;&lt;span class="tgt"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define HDLC_BYTE_FLAG             0x7E
#define HDLC_BYTE_ESC              0x7D
#define HDLC_BYTE_XON              0x11
#define HDLC_BYTE_XOFF             0x13
#define HDLC_BYTE_SPECIAL          0xF8
#define HDLC_ESCAPE_XFORM          0x20

static bool
hdlc_byte_needs_escape(uint8_t byte)
{
	switch(byte) {
	case HDLC_BYTE_SPECIAL:
	case HDLC_BYTE_ESC:
	case HDLC_BYTE_FLAG:
	case HDLC_BYTE_XOFF:
	case HDLC_BYTE_XON:
		return true;

	default:
		return false;
	}
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCP Wpantund, how to customize data sending</title><link>https://devzone.nordicsemi.com/thread/356368?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 15:01:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61aba9d0-2a33-4dea-a18f-61e946516eff</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please post your comment in English, this is an English-only forum. See&amp;nbsp;point 3 in the &lt;a href="https://devzone.nordicsemi.com/p/tos"&gt;DevZone Terms of Service&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCP Wpantund, how to customize data sending</title><link>https://devzone.nordicsemi.com/thread/356166?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 02:15:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1547d56d-1d5d-4218-94c7-8cdc6dfc19d8</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;&lt;span&gt;谢谢。通过使用wpan0接口，我能够对数据传输进行一些测试。&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;目前我们的硬件设计，主机端没有更多的RTS/CTS接口，软件流量控制是唯一的选择，而且我知道它有很多缺点。希望能提供一些相关的设计建议。&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="tgt"&gt;我的意思是HDLC编码。&lt;/span&gt;&lt;span class="tgt"&gt; 我在WPANTund和协处理器中找到了相关代码。我看到XOn/ XOff被定义了。这是软件流控制的保留功能吗？&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="tgt"&gt;在协处理器代码中：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="tgt"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;hdlc.hpp&amp;quot;

enum
{
    kFlagXOn        = 0x11,
    kFlagXOff       = 0x13,
    kFlagSequence   = 0x7e, ///&amp;lt; HDLC Flag value
    kEscapeSequence = 0x7d, ///&amp;lt; HDLC Escape value
    kFlagSpecial    = 0xf8,
};
&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="tgt"&gt;在 WPANTund 代码中：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="tgt"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define HDLC_BYTE_FLAG             0x7E
#define HDLC_BYTE_ESC              0x7D
#define HDLC_BYTE_XON              0x11
#define HDLC_BYTE_XOFF             0x13
#define HDLC_BYTE_SPECIAL          0xF8
#define HDLC_ESCAPE_XFORM          0x20

static bool
hdlc_byte_needs_escape(uint8_t byte)
{
	switch(byte) {
	case HDLC_BYTE_SPECIAL:
	case HDLC_BYTE_ESC:
	case HDLC_BYTE_FLAG:
	case HDLC_BYTE_XOFF:
	case HDLC_BYTE_XON:
		return true;

	default:
		return false;
	}
}
&lt;/pre&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCP Wpantund, how to customize data sending</title><link>https://devzone.nordicsemi.com/thread/356147?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 20:16:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31effd3c-8650-4858-9665-53f37d889751</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t see any commands in the &lt;a href="https://github.com/openthread/wpantund/blob/master/doc/wpanctl.1"&gt;wpanctl documentation&lt;/a&gt;&amp;nbsp;that will enable you to send UDP packets. However, if wpantund is setup correctly, you should be able to send UDP packets to the wpan0 interface configured by wpantund, which should be forwarded to the Thread network.&lt;/p&gt;
&lt;p&gt;It is also possible to use the pyspinel CLI, which s&lt;a href="https://github.com/openthread/pyspinel#openthread-cli-commands"&gt;hould include the same commands supported by the OpenThread CLI example&lt;/a&gt;&amp;nbsp;(I have not tested and verified that this supports UDP command). This can&amp;#39;t be used concurrently with wpantund.&lt;/p&gt;
[quote user=""]I found that there are relevant codes of HDLC software flow control in WPANTund and Coprocessor. How do I verify whether this function is enabled.[/quote]
&lt;p&gt;Not sure exactly what you are referring to here, can you post a link to the relevant codes? We recommend using &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/thread_architectures_ncp.html?cp=8_3_2_3_2_1_0#thread_architectures_details_uart_recommendations"&gt;HW flow control for the NCP&lt;/a&gt; if using UART transport.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>