Golioth Firmware SDK
Loading...
Searching...
No Matches
net_info.h File Reference
#include <golioth/client.h>
#include <golioth/golioth_status.h>
#include <stdint.h>
#include <zcbor_encode.h>

Go to the source code of this file.

Functions

struct golioth_net_info * golioth_net_info_create ()
 
enum golioth_status golioth_net_info_destroy (struct golioth_net_info *info)
 
enum golioth_status golioth_net_info_finish (struct golioth_net_info *info)
 
const uint8_t * golioth_net_info_get_buf (const struct golioth_net_info *info)
 
size_t golioth_net_info_get_buf_len (const struct golioth_net_info *info)
 

Function Documentation

◆ golioth_net_info_create()

struct golioth_net_info * golioth_net_info_create ( )

Create network information

Returns
pointer to golioth_net_info struct
NULL - Error initializing

◆ golioth_net_info_destroy()

enum golioth_status golioth_net_info_destroy ( struct golioth_net_info * info)

Destroy network information

Free the network information after no longer in use.

Parameters
infopointer to golioth_net_info struct
Returns
GOLIOTH_OK - Network information successfully deinitialized
otherwise - Error deinitializing the network information

◆ golioth_net_info_finish()

enum golioth_status golioth_net_info_finish ( struct golioth_net_info * info)

Finish building network information

Needs to be called after filling data with golioth_net_info_*_append() APIs

Parameters
infoNetwork information
Return values
GOLIOTH_OKNetwork information encoding finished successfully
GOLIOTH_ERR_NULLNo network information encoded within request
GOLIOTH_ERR_MEM_ALLOCNot enough memory in network information buffer

◆ golioth_net_info_get_buf()

const uint8_t * golioth_net_info_get_buf ( const struct golioth_net_info * info)

Get serialized CBOR network information

Needs to be called after filling data with golioth_net_info_*_append() APIs, and finishing with golioth_net_info_finish()

Parameters
infoNetwork information
Returns
buffer containing serialized network information

◆ golioth_net_info_get_buf_len()

size_t golioth_net_info_get_buf_len ( const struct golioth_net_info * info)

Get length of serialized CBOR network information

Needs to be called after filling data with golioth_net_info_*_append() APIs, and finishing with golioth_net_info_finish()

Parameters
infoNetwork information
Returns
length of buffer containing serialized network information