Golioth Firmware SDK
Loading...
Searching...
No Matches
lightdb_state.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
15#include <golioth/client.h>
16
22
23//-------------------------------------------------------------------------------
24// LightDB State
25//-------------------------------------------------------------------------------
26
46enum golioth_status golioth_lightdb_set_int(struct golioth_client *client,
47 const char *path,
48 int32_t value,
49 golioth_set_cb_fn callback,
50 void *callback_arg);
51
55enum golioth_status golioth_lightdb_set_bool(struct golioth_client *client,
56 const char *path,
57 bool value,
58 golioth_set_cb_fn callback,
59 void *callback_arg);
60
64enum golioth_status golioth_lightdb_set_float(struct golioth_client *client,
65 const char *path,
66 float value,
67 golioth_set_cb_fn callback,
68 void *callback_arg);
69
73enum golioth_status golioth_lightdb_set_string(struct golioth_client *client,
74 const char *path,
75 const char *str,
76 size_t str_len,
77 golioth_set_cb_fn callback,
78 void *callback_arg);
79
100enum golioth_status golioth_lightdb_set(struct golioth_client *client,
101 const char *path,
102 enum golioth_content_type content_type,
103 const uint8_t *buf,
104 size_t buf_len,
105 golioth_set_cb_fn callback,
106 void *callback_arg);
107
124enum golioth_status golioth_lightdb_get(struct golioth_client *client,
125 const char *path,
126 enum golioth_content_type content_type,
127 golioth_get_cb_fn callback,
128 void *callback_arg);
129
148enum golioth_status golioth_lightdb_delete(struct golioth_client *client,
149 const char *path,
150 golioth_set_cb_fn callback,
151 void *callback_arg);
152
178enum golioth_status golioth_lightdb_observe(struct golioth_client *client,
179 const char *path,
180 enum golioth_content_type content_type,
181 golioth_get_cb_fn callback,
182 void *callback_arg);
183
185
186#ifdef __cplusplus
187}
188#endif
golioth_status
void(* golioth_get_cb_fn)(struct golioth_client *client, enum golioth_status status, const struct golioth_coap_rsp_code *coap_rsp_code, const char *path, const uint8_t *payload, size_t payload_size, void *arg)
Definition client.h:158
void(* golioth_set_cb_fn)(struct golioth_client *client, enum golioth_status status, const struct golioth_coap_rsp_code *coap_rsp_code, const char *path, void *arg)
Definition client.h:254
golioth_content_type
Golioth Content Type.
Definition client.h:45
enum golioth_status golioth_lightdb_set(struct golioth_client *client, const char *path, enum golioth_content_type content_type, const uint8_t *buf, size_t buf_len, golioth_set_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_set_int(struct golioth_client *client, const char *path, int32_t value, golioth_set_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_observe(struct golioth_client *client, const char *path, enum golioth_content_type content_type, golioth_get_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_set_string(struct golioth_client *client, const char *path, const char *str, size_t str_len, golioth_set_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_set_float(struct golioth_client *client, const char *path, float value, golioth_set_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_set_bool(struct golioth_client *client, const char *path, bool value, golioth_set_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_get(struct golioth_client *client, const char *path, enum golioth_content_type content_type, golioth_get_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_delete(struct golioth_client *client, const char *path, golioth_set_cb_fn callback, void *callback_arg)