This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NCP Wpantund, how to customize data sending

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 is enabled.

I hope I can get some help. Thank you very much

  • Hi,

    I can't see any commands in the wpanctl documentation 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.

    It is also possible to use the pyspinel CLI, which should include the same commands supported by the OpenThread CLI example (I have not tested and verified that this supports UDP command). This can't be used concurrently with wpantund.

    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.

    Not sure exactly what you are referring to here, can you post a link to the relevant codes? We recommend using HW flow control for the NCP if using UART transport.

    Best regards,
    Jørgen

  • 谢谢。通过使用wpan0接口,我能够对数据传输进行一些测试。

    目前我们的硬件设计,主机端没有更多的RTS/CTS接口,软件流量控制是唯一的选择,而且我知道它有很多缺点。希望能提供一些相关的设计建议。

    我的意思是HDLC编码。 我在WPANTund和协处理器中找到了相关代码。我看到XOn/ XOff被定义了。这是软件流控制的保留功能吗?

    在协处理器代码中:

    #include "hdlc.hpp"
    
    enum
    {
        kFlagXOn        = 0x11,
        kFlagXOff       = 0x13,
        kFlagSequence   = 0x7e, ///< HDLC Flag value
        kEscapeSequence = 0x7d, ///< HDLC Escape value
        kFlagSpecial    = 0xf8,
    };
    

    在 WPANTund 代码中:

    #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;
    	}
    }
    

  • Hi,

    Please post your comment in English, this is an English-only forum. See point 3 in the DevZone Terms of Service.

    Best regards,
    Jørgen

  • I'm sorry I didn't notice that

    Using the WPAN0 interface, I was able to do some testing on the data transfer

    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. Hope to provide some relevant design suggestions.

    I mean HDLC coding. I found the code in WPANTund and coprocessor. I see XOn/ XOff defined. Is this a reserved feature of software flow control?

    In the Coprocessor code:

    #include "hdlc.hpp"
    
    enum
    {
        kFlagXOn        = 0x11,
        kFlagXOff       = 0x13,
        kFlagSequence   = 0x7e, ///< HDLC Flag value
        kEscapeSequence = 0x7d, ///< HDLC Escape value
        kFlagSpecial    = 0xf8,
    };

    In the Wpantund code:

    #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;
    	}
    }

  • Hi,

    May I ask, is there any way to add software flow control to NCP? Could you give me some suggestions on software flow control.

    Best regards,
    Ethan

Related