Golioth Zephyr SDK
SDK for development of Zephyr OS powered devices with Golioth
golioth.h File Reference
#include <kernel.h>
#include <net/coap.h>
#include <net/tls_credentials.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  golioth_unsecure
 UDP (unsecure) credentials (identity only) of Golioth client. More...
 
struct  golioth_tls
 (D)TLS credentials of Golioth client. More...
 
struct  golioth_client
 Represents a Golioth client instance. More...
 
struct  golioth_blockwise_observe_ctx
 Represents a Golioth blockwise observe context. More...
 
struct  golioth_blockwise_download_ctx
 Represents blockwise download transfer from Golioth. More...
 

Macros

#define GOLIOTH_COAP_MAX_NON_PAYLOAD_LEN   128
 
#define GOLIOTH_MAX_IDENTITY_LEN   32
 
#define GOLIOTH_EMPTY_PACKET_LEN   (16 + GOLIOTH_MAX_IDENTITY_LEN)
 
#define GOLIOTH_LIGHTDB_PATH(x)   ".d/" x
 
#define GOLIOTH_LIGHTDB_STREAM_PATH(x)   ".s/" x
 

Typedefs

typedef int(* golioth_blockwise_observe_received_t) (struct golioth_blockwise_observe_ctx *ctx, const uint8_t *data, size_t offset, size_t len, bool last)
 Type of the callback being called when a single block of data is received as part of CoAP observe notification. More...
 
typedef int(* golioth_blockwise_download_received_t) (struct golioth_blockwise_download_ctx *ctx, const uint8_t *data, size_t offset, size_t len, bool last)
 Type of the callback being called when a single block of data is received as part of CoAP response. More...
 

Functions

void golioth_blockwise_download_init (struct golioth_client *client, struct golioth_blockwise_download_ctx *ctx)
 Initialize blockwise download. More...
 
void golioth_init (struct golioth_client *client)
 Initialize golioth client instance. More...
 
int golioth_connect (struct golioth_client *client, const char *host, uint16_t port)
 Connect to Golioth. More...
 
int golioth_disconnect (struct golioth_client *client)
 Disconnect from Golioth. More...
 
int golioth_set_proto_coap_udp (struct golioth_client *client, uint8_t *identity, size_t identity_len)
 Set UDP as transport protocol. More...
 
int golioth_set_proto_coap_dtls (struct golioth_client *client, sec_tag_t *sec_tag_list, size_t sec_tag_count)
 Set DTLS as transport protocol. More...
 
int golioth_send_coap (struct golioth_client *client, struct coap_packet *packet)
 Send CoAP packet to Golioth. More...
 
int golioth_send_coap_payload (struct golioth_client *client, struct coap_packet *packet, uint8_t *data, uint16_t data_len)
 Send CoAP packet with separate payload to Golioth. More...
 
int golioth_ping (struct golioth_client *client)
 Send PING message to Golioth. More...
 
int golioth_send_hello (struct golioth_client *client)
 Send Hello message to Golioth. More...
 
int golioth_lightdb_get (struct golioth_client *client, const uint8_t *path, enum coap_content_format format, struct coap_reply *reply, coap_reply_t reply_cb)
 Get value from Golioth's Light DB. More...
 
int golioth_lightdb_set (struct golioth_client *client, const uint8_t *path, enum coap_content_format format, uint8_t *data, uint16_t data_len)
 Set value to Golioth's Light DB. More...
 
int golioth_lightdb_delete (struct golioth_client *client, const uint8_t *path)
 Delete value in Golioth's Light DB. More...
 
int golioth_lightdb_observe (struct golioth_client *client, const uint8_t *path, enum coap_content_format format, struct coap_reply *reply, coap_reply_t reply_cb)
 Observe value in Golioth's Light DB. More...
 
int golioth_observe_blockwise (struct golioth_client *client, struct golioth_blockwise_observe_ctx *ctx, const char *path, struct coap_reply *reply, golioth_blockwise_observe_received_t received_cb)
 Observe resource with blockwise updates. More...
 
int golioth_process_rx (struct golioth_client *client)
 Process incoming data from Golioth. More...