Function esp_idf_svc::sys::esp_transport_ws_send_raw

source ยท
pub unsafe extern "C" fn esp_transport_ws_send_raw(
    t: *mut esp_transport_item_t,
    opcode: u32,
    b: *const i8,
    len: i32,
    timeout_ms: i32,
) -> i32
Expand description

@brief Sends websocket raw message with custom opcode and payload

Note that generic esp_transport_write for ws handle sends binary massages by default if size is > 0 and ping message if message size is set to 0. This API is provided to support explicit messages with arbitrary opcode, should it be PING, PONG or TEXT message with arbitrary data.

@param[in] t Websocket transport handle @param[in] opcode ws operation code @param[in] buffer The buffer @param[in] len The length @param[in] timeout_ms The timeout milliseconds (-1 indicates block forever)

@return

  • Number of bytes was written
  • (-1) if there are any errors, should check errno