10#define RPC_MAX_ARGS 16
19typedef struct rpc_function_info
188MOSAPI bool rpc_arg_pb(rpc_context_t *context,
const pb_msgdesc_t *type_fields,
void *val,
size_t argid);
MOSAPI void(1, 2) fatal_abort(const char *fmt
MOSAPI u64 rpc_arg_u64(const rpc_context_t *context, size_t iarg)
MOSAPI rpc_server_t * rpc_server_create(const char *server_name, void *data)
Create a new RPC server.
MOSAPI void rpc_write_result_pb(rpc_context_t *context, const pb_msgdesc_t *type_fields, const void *val)
MOSAPI s32 rpc_arg_next_s32(rpc_context_t *args)
rpc_result_code_t(* rpc_function_t)(rpc_context_t *context)
MOSAPI void rpc_write_result(rpc_context_t *context, const void *data, size_t size)
Write a result to the reply.
MOSAPI void * rpc_context_set_data(rpc_context_t *context, void *data)
Set the context data for an RPC client.
MOSAPI const void * rpc_arg(const rpc_context_t *context, size_t iarg, rpc_argtype_t type, size_t *argsize)
MOSAPI s16 rpc_arg_s16(const rpc_context_t *context, size_t iarg)
MOSAPI const void * rpc_arg_sized_next(rpc_context_t *context, size_t expected_size)
Iterate to the next argument, and check that the size is as expected.
MOSAPI bool rpc_server_register_functions(rpc_server_t *server, const rpc_function_info_t *functions, size_t count)
Register multiple functions with the server.
MOSAPI s8 rpc_arg_next_s8(rpc_context_t *args)
void(* rpc_server_on_disconnect_t)(rpc_context_t *context)
MOSAPI u16 rpc_arg_next_u16(rpc_context_t *args)
MOSAPI bool rpc_arg_pb(rpc_context_t *context, const pb_msgdesc_t *type_fields, void *val, size_t argid)
MOSAPI void rpc_server_close(rpc_server_t *server)
Close the RPC server.
MOSAPI void * rpc_server_get_data(rpc_server_t *server)
Get the user data for the server.
MOSAPI u8 rpc_arg_next_u8(rpc_context_t *args)
MOSAPI u32 rpc_arg_u32(const rpc_context_t *context, size_t iarg)
MOSAPI s64 rpc_arg_s64(const rpc_context_t *context, size_t iarg)
void(* rpc_server_on_connect_t)(rpc_context_t *context)
MOSAPI const char * rpc_arg_next_string(rpc_context_t *context)
MOSAPI int rpc_context_get_function_id(const rpc_context_t *context)
Get the function ID for an RPC call context.
MOSAPI void rpc_server_set_data(rpc_server_t *server, void *data)
Set the user data for the server.
MOSAPI s16 rpc_arg_next_s16(rpc_context_t *args)
MOSAPI void * rpc_context_get_data(const rpc_context_t *context)
Get the context data for an RPC context.
MOSAPI s32 rpc_arg_s32(const rpc_context_t *context, size_t iarg)
MOSAPI void rpc_server_exec(rpc_server_t *server)
Run the server, this function will not return until the server is destroyed.
MOSAPI u16 rpc_arg_u16(const rpc_context_t *context, size_t iarg)
MOSAPI void rpc_server_destroy(rpc_server_t *server)
Destroy the RPC server.
MOSAPI u8 rpc_arg_u8(const rpc_context_t *context, size_t iarg)
MOSAPI s8 rpc_arg_s8(const rpc_context_t *context, size_t iarg)
MOSAPI u32 rpc_arg_next_u32(rpc_context_t *args)
MOSAPI void rpc_server_set_on_connect(rpc_server_t *server, rpc_server_on_connect_t on_connect)
Sets the callback function to be called when a client connects to the RPC server.
MOSAPI rpc_server_t * rpc_context_get_server(const rpc_context_t *context)
Get the RPC server instance for an RPC call context.
MOSAPI u64 rpc_arg_next_u64(rpc_context_t *args)
MOSAPI const char * rpc_arg_string(const rpc_context_t *context, size_t iarg)
MOSAPI void rpc_server_set_on_disconnect(rpc_server_t *server, rpc_server_on_disconnect_t on_disconnect)
Sets the callback function to be called when a client disconnects from the RPC server.
MOSAPI const void * rpc_arg_next(rpc_context_t *args, size_t *size)
Iterate to the next argument.
MOSAPI s64 rpc_arg_next_s64(rpc_context_t *args)