On Message Reception Initialization

Called at every beginning of a WebSocket Data Message.

It first describe the type of data message and the total length of the message to receive. Then, it possible to set an optional pointer to specify where the data must copied automatically.  

Prototype

          void  HTTPc_WebSockOnMsgRxInit (HTTPc_CONN_OBJ            *p_conn,
                                          HTTPc_WEBSOCK_MSG_TYPE     msg_type,
                                          CPU_INT32U                 msg_len,
                                          void                     **p_data);


Arguments

p_conn

Pointer to the current HTTPc Connection Object.

msg_type

Type of WebSocket messge to receive.

msg_len

The total length if the message to receive.

p_data

Pointer to a pointer that can be set to specify where the data must be copied. Specific to the Auto Mode.

Return Values

None.

Required Configuration

Notes / Warnings

  • When a message is fragmented, thus the total message length is unknown, the value will be HTTPc_WEBSOCK_TX_MSG_LEN_NOT_DEFINED.  
  • This hook is set in a HTTPc_WEBSOCK_OBJ using HTTPc_WebSockSetParam() with the parameter HTTPc_PARAM_TYPE_WEBSOCK_ON_MSG_RX_INIT.
  • Must be set to the HTTPc_WEBSOCK_OBJ before upgrading the connection with HTTPc_WebSockUpgrade().