Constants#

This section provides a reference to the WebSocket Client API constants.

Enumerations#

enum
SL_WEBSOCKET_OPCODE_CONTINUE = 0x0
SL_WEBSOCKET_OPCODE_TEXT = 0x1
SL_WEBSOCKET_OPCODE_BINARY = 0x2
SL_WEBSOCKET_OPCODE_CLOSE = 0x8
SL_WEBSOCKET_OPCODE_PING = 0x9
SL_WEBSOCKET_OPCODE_PONG = 0xA
}

WebSocket opcodes for different frame types.

enum
SL_WEBSOCKET_SUCCESS = 0
SL_WEBSOCKET_ERR_SOCKET_CREATION = -1
SL_WEBSOCKET_ERR_SOCKET_BIND = -2
SL_WEBSOCKET_ERR_SOCKET_CONNECT = -3
SL_WEBSOCKET_ERR_SEND_FRAME = -4
SL_WEBSOCKET_ERR_RECEIVE_FRAME = -5
SL_WEBSOCKET_ERR_CLOSE_FRAME = -6
SL_WEBSOCKET_ERR_SSL_SETSOCKOPT = -7
SL_WEBSOCKET_ERR_INVALID_PARAMETER = -8
}

Error codes for WebSocket operations.

enum
SL_WEBSOCKET_STATE_DISCONNECTED
SL_WEBSOCKET_STATE_CONNECTING
SL_WEBSOCKET_STATE_CONNECTED
SL_WEBSOCKET_STATE_CLOSING
SL_WEBSOCKET_STATE_CLOSED
}

WebSocket connection states.

Macros#

#define

Final frame bit.

#define

Websocket max host length.

#define

Websocket max resource length.

Enumeration Documentation#

sl_websocket_opcode_t#

sl_websocket_opcode_t

WebSocket opcodes for different frame types.

This enumeration defines the opcodes used in WebSocket frames to indicate the type of frame being sent or received.

Enumerator
SL_WEBSOCKET_OPCODE_CONTINUE

Continuation frame.

SL_WEBSOCKET_OPCODE_TEXT

Text frame.

SL_WEBSOCKET_OPCODE_BINARY

Binary frame.

SL_WEBSOCKET_OPCODE_CLOSE

Connection close frame.

SL_WEBSOCKET_OPCODE_PING

Ping frame.

SL_WEBSOCKET_OPCODE_PONG

Pong frame.


Definition at line 37 of file components/service/sl_websocket_client/inc/sl_websocket_client_types.h

sl_websocket_error_t#

sl_websocket_error_t

Error codes for WebSocket operations.

This enumeration defines the error codes that can be returned by WebSocket operations to indicate the result of the operation.

Enumerator
SL_WEBSOCKET_SUCCESS

Operation successful.

SL_WEBSOCKET_ERR_SOCKET_CREATION

Error creating socket.

SL_WEBSOCKET_ERR_SOCKET_BIND

Error binding socket.

SL_WEBSOCKET_ERR_SOCKET_CONNECT

Error connecting socket.

SL_WEBSOCKET_ERR_SEND_FRAME

Error sending frame.

SL_WEBSOCKET_ERR_RECEIVE_FRAME

Error receiving frame.

SL_WEBSOCKET_ERR_CLOSE_FRAME

Error closing frame.

SL_WEBSOCKET_ERR_SSL_SETSOCKOPT

Error setting socket options for SSL.

SL_WEBSOCKET_ERR_INVALID_PARAMETER

Invalid input parameter.


Definition at line 51 of file components/service/sl_websocket_client/inc/sl_websocket_client_types.h

sl_websocket_state_t#

sl_websocket_state_t

WebSocket connection states.

This enumeration defines the possible states of a WebSocket connection.

Enumerator
SL_WEBSOCKET_STATE_DISCONNECTED

The WebSocket client is not connected to the server.

SL_WEBSOCKET_STATE_CONNECTING

The WebSocket client is in the process of establishing a connection to the server.

SL_WEBSOCKET_STATE_CONNECTED

The WebSocket client is successfully connected to the server.

SL_WEBSOCKET_STATE_CLOSING

The WebSocket client is in the process of closing the connection.

SL_WEBSOCKET_STATE_CLOSED

The WebSocket connection has been closed.


Definition at line 68 of file components/service/sl_websocket_client/inc/sl_websocket_client_types.h

Macro Definition Documentation#

SL_WEBSOCKET_FIN_BIT#

#define SL_WEBSOCKET_FIN_BIT
Value:
0x80

Final frame bit.

Not to be configured by the user.


Definition at line 21 of file components/service/sl_websocket_client/inc/sl_websocket_client_types.h

SL_SI91X_WEBSOCKET_MAX_HOST_LENGTH#

#define SL_SI91X_WEBSOCKET_MAX_HOST_LENGTH
Value:
51

Websocket max host length.

Not to be configured by the user.


Definition at line 23 of file components/service/sl_websocket_client/inc/sl_websocket_client_types.h

SL_SI91X_WEBSOCKET_MAX_RESOURCE_LENGTH#

#define SL_SI91X_WEBSOCKET_MAX_RESOURCE_LENGTH
Value:
  51

Websocket max resource length.

Not to be configured by the user.


Definition at line 25 of file components/service/sl_websocket_client/inc/sl_websocket_client_types.h