LiveKit ESP32 SDK
Loading...
Searching...
No Matches
Remote Method Calls (RPC)

Use RPC to execute custom methods on other participants in the room and await a response. More...

Macros

#define LIVEKIT_RPC_MAX_PAYLOAD_BYTES   15360
 Maximum payload size for RPC messages.

Typedefs

typedef void(* livekit_rpc_handler_t) (const livekit_rpc_invocation_t *invocation, void *ctx)
 Handler for an RPC invocation.

Functions

livekit_err_t livekit_room_rpc_register (livekit_room_handle_t handle, const char *method, livekit_rpc_handler_t handler)
 Registers a handler for an RPC method.
livekit_err_t livekit_room_rpc_unregister (livekit_room_handle_t handle, const char *method)
 Unregisters a handler for an RPC method.

Detailed Description

Use RPC to execute custom methods on other participants in the room and await a response.

For more information about this feature, see the LiveKit documentation.

Macro Definition Documentation

◆ LIVEKIT_RPC_MAX_PAYLOAD_BYTES

#define LIVEKIT_RPC_MAX_PAYLOAD_BYTES   15360

Maximum payload size for RPC messages.

Typedef Documentation

◆ livekit_rpc_handler_t

typedef void(* livekit_rpc_handler_t) (const livekit_rpc_invocation_t *invocation, void *ctx)

Handler for an RPC invocation.

Function Documentation

◆ livekit_room_rpc_register()

livekit_err_t livekit_room_rpc_register ( livekit_room_handle_t handle,
const char * method,
livekit_rpc_handler_t handler )

Registers a handler for an RPC method.

Once registered, the method can be invoked by remote participants in the room.

Parameters
handle[in]Room handle.
method[in]Name of the method to register.
handler[in]Handler function to call when the method is invoked by a remote participant.
Exceptions
Ifa handler for the method is already registered, an error is returned.
Returns
LIVEKIT_ERR_NONE if successful, otherwise an error code.

◆ livekit_room_rpc_unregister()

livekit_err_t livekit_room_rpc_unregister ( livekit_room_handle_t handle,
const char * method )

Unregisters a handler for an RPC method.

Parameters
handle[in]Room handle.
method[in]Name of the method to unregister.
Returns
LIVEKIT_ERR_NONE if successful, otherwise an error code.