Golioth Firmware SDK
Loading...
Searching...
No Matches
client.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <golioth/golioth_status.h>
#include "golioth_sys.h"

Go to the source code of this file.

Data Structures

struct  golioth_coap_rsp_code
 CoAP response code returned by server. More...
 
struct  golioth_psk_credential
 
struct  golioth_pki_credential
 
struct  golioth_credential
 TLS Authentication Credential. More...
 
struct  golioth_client_config
 Golioth client configuration, passed into golioth_client_create. More...
 

Typedefs

typedef void(* golioth_client_event_cb_fn) (struct golioth_client *client, enum golioth_client_event event, void *arg)
 
typedef void(* golioth_get_cb_fn) (struct golioth_client *client, enum golioth_status status, const struct golioth_coap_rsp_code *coap_rsp_code, const char *path, const uint8_t *payload, size_t payload_size, void *arg)
 
typedef void(* golioth_get_block_cb_fn) (struct golioth_client *client, enum golioth_status status, const struct golioth_coap_rsp_code *coap_rsp_code, const char *path, const uint8_t *payload, size_t payload_size, bool is_last, void *arg)
 
typedef void(* golioth_set_cb_fn) (struct golioth_client *client, enum golioth_status status, const struct golioth_coap_rsp_code *coap_rsp_code, const char *path, void *arg)
 

Enumerations

enum  golioth_client_event { GOLIOTH_CLIENT_EVENT_CONNECTED , GOLIOTH_CLIENT_EVENT_DISCONNECTED }
 Golioth client events. More...
 
enum  golioth_content_type { GOLIOTH_CONTENT_TYPE_JSON , GOLIOTH_CONTENT_TYPE_CBOR , GOLIOTH_CONTENT_TYPE_OCTET_STREAM }
 Golioth Content Type. More...
 
enum  golioth_auth_type { GOLIOTH_TLS_AUTH_TYPE_PSK , GOLIOTH_TLS_AUTH_TYPE_PKI , GOLIOTH_TLS_AUTH_TYPE_TAG }
 Authentication type. More...
 

Functions

struct golioth_client * golioth_client_create (const struct golioth_client_config *config)
 
bool golioth_client_wait_for_connect (struct golioth_client *client, int timeout_ms)
 
enum golioth_status golioth_client_start (struct golioth_client *client)
 
enum golioth_status golioth_client_stop (struct golioth_client *client)
 
void golioth_client_destroy (struct golioth_client *client)
 
bool golioth_client_is_running (struct golioth_client *client)
 
bool golioth_client_is_connected (struct golioth_client *client)
 
void golioth_client_register_event_callback (struct golioth_client *client, golioth_client_event_cb_fn callback, void *arg)
 
uint32_t golioth_client_num_items_in_request_queue (struct golioth_client *client)
 
void golioth_client_set_packet_loss_percent (uint8_t percent)
 
golioth_sys_thread_t golioth_client_get_thread (struct golioth_client *client)