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#pragma once
7
9#include <golioth/client.h>
10
16
17//-------------------------------------------------------------------------------
18// LightDB State
19//-------------------------------------------------------------------------------
20
40enum golioth_status golioth_lightdb_set_int_async(struct golioth_client *client,
41 const char *path,
42 int32_t value,
43 golioth_set_cb_fn callback,
44 void *callback_arg);
45
65enum golioth_status golioth_lightdb_set_int_sync(struct golioth_client *client,
66 const char *path,
67 int32_t value,
68 int32_t timeout_s);
69
73enum golioth_status golioth_lightdb_set_bool_async(struct golioth_client *client,
74 const char *path,
75 bool value,
76 golioth_set_cb_fn callback,
77 void *callback_arg);
78
82enum golioth_status golioth_lightdb_set_bool_sync(struct golioth_client *client,
83 const char *path,
84 bool value,
85 int32_t timeout_s);
86
90enum golioth_status golioth_lightdb_set_float_async(struct golioth_client *client,
91 const char *path,
92 float value,
93 golioth_set_cb_fn callback,
94 void *callback_arg);
95
96enum golioth_status golioth_lightdb_set_float_sync(struct golioth_client *client,
97 const char *path,
98 float value,
99 int32_t timeout_s);
100
104enum golioth_status golioth_lightdb_set_string_async(struct golioth_client *client,
105 const char *path,
106 const char *str,
107 size_t str_len,
108 golioth_set_cb_fn callback,
109 void *callback_arg);
110
111enum golioth_status golioth_lightdb_set_string_sync(struct golioth_client *client,
112 const char *path,
113 const char *str,
114 size_t str_len,
115 int32_t timeout_s);
116
137enum golioth_status golioth_lightdb_set_async(struct golioth_client *client,
138 const char *path,
139 enum golioth_content_type content_type,
140 const uint8_t *buf,
141 size_t buf_len,
142 golioth_set_cb_fn callback,
143 void *callback_arg);
144
158enum golioth_status golioth_lightdb_set_sync(struct golioth_client *client,
159 const char *path,
160 enum golioth_content_type content_type,
161 const uint8_t *buf,
162 size_t buf_len,
163 int32_t timeout_s);
164
181enum golioth_status golioth_lightdb_get_async(struct golioth_client *client,
182 const char *path,
183 enum golioth_content_type content_type,
184 golioth_get_cb_fn callback,
185 void *callback_arg);
186
205enum golioth_status golioth_lightdb_get_int_sync(struct golioth_client *client,
206 const char *path,
207 int32_t *value,
208 int32_t timeout_s);
209
211enum golioth_status golioth_lightdb_get_bool_sync(struct golioth_client *client,
212 const char *path,
213 bool *value,
214 int32_t timeout_s);
215
217enum golioth_status golioth_lightdb_get_float_sync(struct golioth_client *client,
218 const char *path,
219 float *value,
220 int32_t timeout_s);
221
223enum golioth_status golioth_lightdb_get_string_sync(struct golioth_client *client,
224 const char *path,
225 char *strbuf,
226 size_t strbuf_size,
227 int32_t timeout_s);
228
230enum golioth_status golioth_lightdb_get_sync(struct golioth_client *client,
231 const char *path,
232 enum golioth_content_type content_type,
233 uint8_t *buf,
234 size_t *buf_size,
235 int32_t timeout_s);
236
255enum golioth_status golioth_lightdb_delete_async(struct golioth_client *client,
256 const char *path,
257 golioth_set_cb_fn callback,
258 void *callback_arg);
259
277enum golioth_status golioth_lightdb_delete_sync(struct golioth_client *client,
278 const char *path,
279 int32_t timeout_s);
280
305enum golioth_status golioth_lightdb_observe_async(struct golioth_client *client,
306 const char *path,
307 golioth_get_cb_fn callback,
308 void *callback_arg);
309
golioth_status
golioth_content_type
Golioth Content Type.
Definition client.h:41
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:146
void(* golioth_set_cb_fn)(struct golioth_client *client, const struct golioth_response *response, const char *path, void *arg)
Definition client.h:172
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, 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)