Golioth Zephyr SDK
Golioth LightDB

Functions

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) More...
 
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) More...
 
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) More...
 
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) More...
 
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) More...
 
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) More...
 
int golioth_lightdb_delete (struct golioth_client *client, const uint8_t *path)
 Delete value in Golioth's LightDB (synchronous) More...
 

Detailed Description

Functions for interacting with the Golioth LightDB service

Function Documentation

◆ golioth_lightdb_delete()

int golioth_lightdb_delete ( struct golioth_client client,
const uint8_t *  path 
)

Delete value in Golioth's LightDB (synchronous)

Synchronously delete value in Golioth's LightDB.

Parameters
[in]clientClient instance
[in]pathLightDB resource path
Return values
0On success
<0On failure

◆ golioth_lightdb_delete_cb()

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)

Asynchronously request to delete value in Golioth's LightDB and let cb be invoked when server acknowledges it or some error condition happens.

Warning
Experimental API
Parameters
[in]clientClient instance
[in]pathLightDB resource path
[in]cbCallback executed on acknowledgment received, timeout or error
[in]user_dataUser data passed to cb
Return values
0On success
<0On failure

◆ golioth_lightdb_get()

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)

Synchronously get value from Golioth's LightDB and store it into preallocated buffer.

Parameters
[in]clientClient instance
[in]pathLightDB resource path
[in]formatRequested format of payload
[in]dataBuffer for received data
[in,out]lenSize of buffer on input, size of response on output
Return values
0On success
<0On failure

◆ golioth_lightdb_get_cb()

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)

Asynchronously request value from Golioth's LightDB and let cb be invoked when such value is retrieved or some error condtition happens.

Warning
Experimental API
Parameters
[in]clientClient instance
[in]pathLightDB resource path
[in]formatRequested format of payload
[in]cbCallback executed on response received, timeout or error
[in]user_dataUser data passed to cb
Return values
0On success
<0On failure

◆ golioth_lightdb_observe_cb()

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)

Asynchronously request to observe value in Golioth's LightDB and let cb be invoked when such value is retrieved (for the first time or after an update) or some error condition happens.

Warning
Experimental API
Parameters
[in]clientClient instance
[in]pathLightDB resource path
[in]formatRequested format of payload
[in]cbCallback executed on response received, timeout or error
[in]user_dataUser data passed to cb
Return values
0On success
<0On failure

◆ golioth_lightdb_set()

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)

Synchronously set new value to LightDB.

Parameters
[in]clientClient instance
[in]pathLightDB resource path
[in]formatFormat of payload
[in]dataPayload data
[in]data_lenPayload length
Return values
0On success
<0On failure

◆ golioth_lightdb_set_cb()

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)

Asynchronously request to store new value to LightDB and let cb be invoked when such value is actually stored or some error condition happens.

Warning
Experimental API
Parameters
[in]clientClient instance
[in]pathLightDB resource path
[in]formatRequested format of payload
[in]dataPointer to data to be set
[in]data_lenLength of data to be set
[in]cbCallback executed on response received, timeout or error
[in]user_dataUser data passed to cb
Return values
0On success
<0On failure