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#pragma once
7
8#include <zcbor_decode.h>
9#include <zcbor_encode.h>
11#include <golioth/client.h>
12
16
17struct golioth_rpc;
18
40
82typedef enum golioth_rpc_status (*golioth_rpc_cb_fn)(zcbor_state_t *request_params_array,
83 zcbor_state_t *response_detail_map,
84 void *callback_arg);
85
92struct golioth_rpc *golioth_rpc_init(struct golioth_client *client);
93
104enum golioth_status golioth_rpc_register(struct golioth_rpc *grpc,
105 const char *method,
106 golioth_rpc_cb_fn callback,
107 void *callback_arg);
108
golioth_status
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:82
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:21
@ GOLIOTH_RPC_ABORTED
Definition rpc.h:32
@ GOLIOTH_RPC_UNAVAILABLE
Definition rpc.h:36
@ GOLIOTH_RPC_UNKNOWN
Definition rpc.h:24
@ GOLIOTH_RPC_OUT_OF_RANGE
Definition rpc.h:33
@ GOLIOTH_RPC_ALREADYEXISTS
Definition rpc.h:28
@ GOLIOTH_RPC_INVALID_ARGUMENT
Definition rpc.h:25
@ GOLIOTH_RPC_PERMISSION_DENIED
Definition rpc.h:29
@ GOLIOTH_RPC_DATA_LOSS
Definition rpc.h:37
@ GOLIOTH_RPC_INTERNAL
Definition rpc.h:35
@ GOLIOTH_RPC_RESOURCE_EXHAUSTED
Definition rpc.h:30
@ GOLIOTH_RPC_OK
Definition rpc.h:22
@ GOLIOTH_RPC_NOT_FOUND
Definition rpc.h:27
@ GOLIOTH_RPC_UNAUTHENTICATED
Definition rpc.h:38
@ GOLIOTH_RPC_DEADLINE_EXCEEDED
Definition rpc.h:26
@ GOLIOTH_RPC_FAILED_PRECONDITION
Definition rpc.h:31
@ GOLIOTH_RPC_UNIMPLEMENTED
Definition rpc.h:34
@ GOLIOTH_RPC_CANCELED
Definition rpc.h:23