This is the multi-page printable view of this section. Click here to print...

Return to the regular view of this page

As of 2025-07-24

TwePacketUART

Packet from App_UART
    The TwePacketAppUart class represents the extended format of App_UART received by the parent or repeater application App_Wings.
    class TwePacketAppUART : public TwePacket, public DataAppUART

    After executing parse<TwePacketUART>(), the packet information is stored in DataAppUART.

    DataAppUART Struct

    struct DataAppUART {
    		/**
    		 * source address (Serial ID)
    		 */
    		uint32_t u32addr_src;
    
    		/**
    		 * source address (Serial ID)
    		 */
    		uint32_t u32addr_dst;
    
    		/**
    		 * source address (logical ID)
    		 */
    		uint8_t u8addr_src;
    
    		/**
    		 * destination address (logical ID)
    		 */
    		uint8_t u8addr_dst;
    
    		/**
    		 * LQI value
    		 */
    		uint8_t u8lqi;
    
    		/**
    		 * Response ID
    		 */
    		uint8_t u8response_id;
    
    		/**
    		 * Payload length
    		 */
    		uint16_t u16paylen;
    
    		/**
    		 * payload
    		 */
    ##if MWX_PARSER_PKT_APPUART_FIXED_BUF == 0
    		mwx::smplbuf_u8_attach payload;
    ##else
    		mwx::smplbuf_u8<MWX_PARSER_PKT_APPUART_FIXED_BUF> payload;
    ##endif
    	};

    payload represents the data portion, but the storage method varies depending on the macro definition.

    If MWX_PARSER_PKT_APPUART_FIXED_BUF is set to 0 during compilation, payload will reference the byte sequence directly. If the original byte sequence is modified, the data in payload may become corrupted.

    If MWX_PARSER_PKT_APPUART_FIXED_BUF is defined with a value greater than 0, a buffer of that size (in bytes) is allocated for payload. However, if the size of the serial data exceeds the buffer, parse<TwePacketAppUART>() will fail and return E_PKT::PKT_ERROR.