Golioth Firmware SDK
Loading...
Searching...
No Matches
rpc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Golioth, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifdef __cplusplus
8extern "C"
9{
10#endif
11
12#pragma once
13
14#include <zcbor_decode.h>
15#include <zcbor_encode.h>
17#include <golioth/client.h>
18
22
23struct golioth_rpc;
24
46
88typedef enum golioth_rpc_status (*golioth_rpc_cb_fn)(zcbor_state_t *request_params_array,
89 zcbor_state_t *response_detail_map,
90 void *callback_arg);
91
98struct golioth_rpc *golioth_rpc_init(struct golioth_client *client);
99
108enum golioth_status golioth_rpc_deinit(struct golioth_rpc *grpc);
109
120enum golioth_status golioth_rpc_register(struct golioth_rpc *grpc,
121 const char *method,
122 golioth_rpc_cb_fn callback,
123 void *callback_arg);
124
126
127#ifdef __cplusplus
128}
129#endif
golioth_status
enum golioth_status golioth_rpc_deinit(struct golioth_rpc *grpc)
struct golioth_rpc * golioth_rpc_init(struct golioth_client *client)
enum golioth_rpc_status(* golioth_rpc_cb_fn)(zcbor_state_t *request_params_array, zcbor_state_t *response_detail_map, void *callback_arg)
Definition rpc.h:88
enum golioth_status golioth_rpc_register(struct golioth_rpc *grpc, const char *method, golioth_rpc_cb_fn callback, void *callback_arg)
golioth_rpc_status
Enumeration of RPC status codes, sent in the RPC response.
Definition rpc.h:27
@ GOLIOTH_RPC_ABORTED
Definition rpc.h:38
@ GOLIOTH_RPC_UNAVAILABLE
Definition rpc.h:42
@ GOLIOTH_RPC_UNKNOWN
Definition rpc.h:30
@ GOLIOTH_RPC_OUT_OF_RANGE
Definition rpc.h:39
@ GOLIOTH_RPC_ALREADYEXISTS
Definition rpc.h:34
@ GOLIOTH_RPC_INVALID_ARGUMENT
Definition rpc.h:31
@ GOLIOTH_RPC_PERMISSION_DENIED
Definition rpc.h:35
@ GOLIOTH_RPC_DATA_LOSS
Definition rpc.h:43
@ GOLIOTH_RPC_INTERNAL
Definition rpc.h:41
@ GOLIOTH_RPC_RESOURCE_EXHAUSTED
Definition rpc.h:36
@ GOLIOTH_RPC_OK
Definition rpc.h:28
@ GOLIOTH_RPC_NOT_FOUND
Definition rpc.h:33
@ GOLIOTH_RPC_UNAUTHENTICATED
Definition rpc.h:44
@ GOLIOTH_RPC_DEADLINE_EXCEEDED
Definition rpc.h:32
@ GOLIOTH_RPC_FAILED_PRECONDITION
Definition rpc.h:37
@ GOLIOTH_RPC_UNIMPLEMENTED
Definition rpc.h:40
@ GOLIOTH_RPC_CANCELED
Definition rpc.h:29