LiveKit ESP32 SDK
Loading...
Searching...
No Matches
Connection

Connect and disconnect from a room. More...

Enumerations

enum  livekit_connection_state_t {
  LIVEKIT_CONNECTION_STATE_DISCONNECTED = 0 , LIVEKIT_CONNECTION_STATE_CONNECTING = 1 , LIVEKIT_CONNECTION_STATE_CONNECTED = 2 , LIVEKIT_CONNECTION_STATE_RECONNECTING = 3 ,
  LIVEKIT_CONNECTION_STATE_FAILED = 4
}
 Connection state of a room. More...

Functions

livekit_err_t livekit_room_connect (livekit_room_handle_t handle, const char *server_url, const char *token)
 Connects to a room asynchronously.
livekit_err_t livekit_room_close (livekit_room_handle_t handle)
 Disconnects from a room asynchronously.
livekit_connection_state_t livekit_room_get_state (livekit_room_handle_t handle)
 Gets the current connection state of a room.
const char * livekit_connection_state_str (livekit_connection_state_t state)
 Gets a string representation of a connection state.

Detailed Description

Connect and disconnect from a room.

The connection state of a room can be monitored by setting a handler for livekit_room_options_t::on_state_changed.

Enumeration Type Documentation

◆ livekit_connection_state_t

Connection state of a room.

Enumerator
LIVEKIT_CONNECTION_STATE_DISCONNECTED 

Disconnected.

LIVEKIT_CONNECTION_STATE_CONNECTING 

Establishing connection.

LIVEKIT_CONNECTION_STATE_CONNECTED 

Connected.

LIVEKIT_CONNECTION_STATE_RECONNECTING 

Connection was previously established, but was lost.

LIVEKIT_CONNECTION_STATE_FAILED 

Connection failed.

Function Documentation

◆ livekit_connection_state_str()

const char * livekit_connection_state_str ( livekit_connection_state_t state)

Gets a string representation of a connection state.

Parameters
state[in]Connection state.
Returns
String representation of the connection state.

◆ livekit_room_close()

livekit_err_t livekit_room_close ( livekit_room_handle_t handle)

Disconnects from a room asynchronously.

Parameters
handle[in]Room handle.
Returns
LIVEKIT_ERR_NONE if successful, otherwise an error code.

◆ livekit_room_connect()

livekit_err_t livekit_room_connect ( livekit_room_handle_t handle,
const char * server_url,
const char * token )

Connects to a room asynchronously.

Parameters
handle[in]Room handle.
server_url[in]URL of the LiveKit server beginning with "wss://" or "ws://".
token[in]Server-generated token for authentication.
Returns
LIVEKIT_ERR_NONE, otherwise an error code.

◆ livekit_room_get_state()

livekit_connection_state_t livekit_room_get_state ( livekit_room_handle_t handle)

Gets the current connection state of a room.

Parameters
handle[in]Room handle.
Returns
Current connection state.