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_async(struct golioth_client *client,
47 const char *path,
48 int32_t value,
49 golioth_set_cb_fn callback,
50 void *callback_arg);
51
71enum golioth_status golioth_lightdb_set_int_sync(struct golioth_client *client,
72 const char *path,
73 int32_t value,
74 int32_t timeout_s);
75
79enum golioth_status golioth_lightdb_set_bool_async(struct golioth_client *client,
80 const char *path,
81 bool value,
82 golioth_set_cb_fn callback,
83 void *callback_arg);
84
88enum golioth_status golioth_lightdb_set_bool_sync(struct golioth_client *client,
89 const char *path,
90 bool value,
91 int32_t timeout_s);
92
96enum golioth_status golioth_lightdb_set_float_async(struct golioth_client *client,
97 const char *path,
98 float value,
99 golioth_set_cb_fn callback,
100 void *callback_arg);
101
102enum golioth_status golioth_lightdb_set_float_sync(struct golioth_client *client,
103 const char *path,
104 float value,
105 int32_t timeout_s);
106
110enum golioth_status golioth_lightdb_set_string_async(struct golioth_client *client,
111 const char *path,
112 const char *str,
113 size_t str_len,
114 golioth_set_cb_fn callback,
115 void *callback_arg);
116
117enum golioth_status golioth_lightdb_set_string_sync(struct golioth_client *client,
118 const char *path,
119 const char *str,
120 size_t str_len,
121 int32_t timeout_s);
122
143enum golioth_status golioth_lightdb_set_async(struct golioth_client *client,
144 const char *path,
145 enum golioth_content_type content_type,
146 const uint8_t *buf,
147 size_t buf_len,
148 golioth_set_cb_fn callback,
149 void *callback_arg);
150
164enum golioth_status golioth_lightdb_set_sync(struct golioth_client *client,
165 const char *path,
166 enum golioth_content_type content_type,
167 const uint8_t *buf,
168 size_t buf_len,
169 int32_t timeout_s);
170
187enum golioth_status golioth_lightdb_get_async(struct golioth_client *client,
188 const char *path,
189 enum golioth_content_type content_type,
190 golioth_get_cb_fn callback,
191 void *callback_arg);
192
211enum golioth_status golioth_lightdb_get_int_sync(struct golioth_client *client,
212 const char *path,
213 int32_t *value,
214 int32_t timeout_s);
215
217enum golioth_status golioth_lightdb_get_bool_sync(struct golioth_client *client,
218 const char *path,
219 bool *value,
220 int32_t timeout_s);
221
223enum golioth_status golioth_lightdb_get_float_sync(struct golioth_client *client,
224 const char *path,
225 float *value,
226 int32_t timeout_s);
227
229enum golioth_status golioth_lightdb_get_string_sync(struct golioth_client *client,
230 const char *path,
231 char *strbuf,
232 size_t strbuf_size,
233 int32_t timeout_s);
234
236enum golioth_status golioth_lightdb_get_sync(struct golioth_client *client,
237 const char *path,
238 enum golioth_content_type content_type,
239 uint8_t *buf,
240 size_t *buf_size,
241 int32_t timeout_s);
242
261enum golioth_status golioth_lightdb_delete_async(struct golioth_client *client,
262 const char *path,
263 golioth_set_cb_fn callback,
264 void *callback_arg);
265
283enum golioth_status golioth_lightdb_delete_sync(struct golioth_client *client,
284 const char *path,
285 int32_t timeout_s);
286
312enum golioth_status golioth_lightdb_observe_async(struct golioth_client *client,
313 const char *path,
314 enum golioth_content_type content_type,
315 golioth_get_cb_fn callback,
316 void *callback_arg);
317
319
320#ifdef __cplusplus
321}
322#endif
golioth_status
golioth_content_type
Golioth Content Type.
Definition client.h:47
void(* golioth_get_cb_fn)(struct golioth_client *client, const struct golioth_response *response, const char *path, const uint8_t *payload, size_t payload_size, void *arg)
Definition client.h:153
void(* golioth_set_cb_fn)(struct golioth_client *client, const struct golioth_response *response, const char *path, void *arg)
Definition client.h:179
enum golioth_status golioth_lightdb_set_int_async(struct golioth_client *client, const char *path, int32_t value, golioth_set_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_set_float_sync(struct golioth_client *client, const char *path, float value, int32_t timeout_s)
enum golioth_status golioth_lightdb_get_sync(struct golioth_client *client, const char *path, enum golioth_content_type content_type, uint8_t *buf, size_t *buf_size, int32_t timeout_s)
Similar to golioth_lightdb_get_int_sync, but for objects.
enum golioth_status golioth_lightdb_set_async(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_sync(struct golioth_client *client, const char *path, int32_t value, int32_t timeout_s)
enum golioth_status golioth_lightdb_set_float_async(struct golioth_client *client, const char *path, float value, golioth_set_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_set_sync(struct golioth_client *client, const char *path, enum golioth_content_type content_type, const uint8_t *buf, size_t buf_len, int32_t timeout_s)
enum golioth_status golioth_lightdb_observe_async(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_bool_async(struct golioth_client *client, const char *path, bool value, golioth_set_cb_fn callback, void *callback_arg)
enum golioth_status golioth_lightdb_set_string_sync(struct golioth_client *client, const char *path, const char *str, size_t str_len, int32_t timeout_s)
enum golioth_status golioth_lightdb_get_async(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_sync(struct golioth_client *client, const char *path, int32_t timeout_s)
enum golioth_status golioth_lightdb_get_float_sync(struct golioth_client *client, const char *path, float *value, int32_t timeout_s)
Similar to golioth_lightdb_get_int_sync, but for type float.
enum golioth_status golioth_lightdb_set_string_async(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_get_int_sync(struct golioth_client *client, const char *path, int32_t *value, int32_t timeout_s)
enum golioth_status golioth_lightdb_get_bool_sync(struct golioth_client *client, const char *path, bool *value, int32_t timeout_s)
Similar to golioth_lightdb_get_int_sync, but for type bool.
enum golioth_status golioth_lightdb_get_string_sync(struct golioth_client *client, const char *path, char *strbuf, size_t strbuf_size, int32_t timeout_s)
Similar to golioth_lightdb_get_int_sync, but for type string.
enum golioth_status golioth_lightdb_set_bool_sync(struct golioth_client *client, const char *path, bool value, int32_t timeout_s)
enum golioth_status golioth_lightdb_delete_async(struct golioth_client *client, const char *path, golioth_set_cb_fn callback, void *callback_arg)