Golioth Zephyr SDK
lightdb.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 #ifndef GOLIOTH_INCLUDE_NET_GOLIOTH_LIGHTDB_H_
8 #define GOLIOTH_INCLUDE_NET_GOLIOTH_LIGHTDB_H_
9 
10 #include <stdint.h>
11 #include <zephyr/net/coap.h>
12 #include <net/golioth/req.h>
13 
21 struct golioth_client;
23 
41 int golioth_lightdb_get_cb(struct golioth_client *client, const uint8_t *path,
42  enum golioth_content_format format,
43  golioth_req_cb_t cb, void *user_data);
44 
59 int golioth_lightdb_get(struct golioth_client *client, const uint8_t *path,
60  enum golioth_content_format format,
61  uint8_t *data, size_t *len);
62 
82 int golioth_lightdb_set_cb(struct golioth_client *client, const uint8_t *path,
83  enum golioth_content_format format,
84  const uint8_t *data, size_t data_len,
85  golioth_req_cb_t cb, void *user_data);
86 
101 int golioth_lightdb_set(struct golioth_client *client, const uint8_t *path,
102  enum golioth_content_format format,
103  const uint8_t *data, size_t data_len);
104 
122 int golioth_lightdb_observe_cb(struct golioth_client *client, const uint8_t *path,
123  enum golioth_content_format format,
124  golioth_req_cb_t cb, void *user_data);
125 
142 int golioth_lightdb_delete_cb(struct golioth_client *client, const uint8_t *path,
143  golioth_req_cb_t cb, void *user_data);
144 
156 int golioth_lightdb_delete(struct golioth_client *client, const uint8_t *path);
157 
160 #endif /* GOLIOTH_INCLUDE_NET_GOLIOTH_LIGHTDB_H_ */
int golioth_lightdb_get(struct golioth_client *client, const uint8_t *path, enum golioth_content_format format, uint8_t *data, size_t *len)
Get value from Golioth's LightDB (synchronous, into preallocated buffer)
int golioth_lightdb_set_cb(struct golioth_client *client, const uint8_t *path, enum golioth_content_format format, const uint8_t *data, size_t data_len, golioth_req_cb_t cb, void *user_data)
Set value to Golioth's LightDB (callback based)
int golioth_lightdb_delete(struct golioth_client *client, const uint8_t *path)
Delete value in Golioth's LightDB (synchronous)
int golioth_lightdb_delete_cb(struct golioth_client *client, const uint8_t *path, golioth_req_cb_t cb, void *user_data)
Delete value in Golioth's LightDB (callback based)
int golioth_lightdb_observe_cb(struct golioth_client *client, const uint8_t *path, enum golioth_content_format format, golioth_req_cb_t cb, void *user_data)
Observe value in Golioth's LightDB (callback based)
int golioth_lightdb_set(struct golioth_client *client, const uint8_t *path, enum golioth_content_format format, const uint8_t *data, size_t data_len)
Set value to Golioth's LightDB (synchronously)
int golioth_lightdb_get_cb(struct golioth_client *client, const uint8_t *path, enum golioth_content_format format, golioth_req_cb_t cb, void *user_data)
Get value from Golioth's LightDB (callback based)
golioth_content_format
Set of Content-Format option values for Golioth APIs.
Definition: net/golioth.h:33
int(* golioth_req_cb_t)(struct golioth_req_rsp *rsp)
User callback for handling valid response from server or error condition.
Definition: req.h:51
Represents a Golioth client instance.
Definition: net/golioth.h:50