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
  • 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

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

Reply
  • 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;
    	}
    }

Children
No Data
Related