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

Parents Reply Children
  • 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