7 #ifndef GOLIOTH_INCLUDE_NET_GOLIOTH_H_
8 #define GOLIOTH_INCLUDE_NET_GOLIOTH_H_
15 #include <zephyr/kernel.h>
16 #include <zephyr/net/coap.h>
17 #include <zephyr/net/tls_credentials.h>
25 #define GOLIOTH_COAP_MAX_NON_PAYLOAD_LEN 128
27 #define GOLIOTH_MAX_IDENTITY_LEN 32
28 #define GOLIOTH_EMPTY_PACKET_LEN (16 + GOLIOTH_MAX_IDENTITY_LEN)
78 k_mutex_lock(&client->
lock, K_FOREVER);
83 k_mutex_unlock(&client->
lock);
151 sec_tag_t *sec_tag_list,
152 size_t sec_tag_count);
166 struct coap_packet *packet);
183 struct coap_packet *packet,
184 uint8_t *data, uint16_t data_len);
232 int *fd, int64_t *timeout);
int golioth_ping(struct golioth_client *client)
Send PING message to Golioth.
static void golioth_lock(struct golioth_client *client)
int golioth_process_rx(struct golioth_client *client)
Process incoming data from Golioth.
int golioth_send_coap(struct golioth_client *client, struct coap_packet *packet)
Send CoAP packet to Golioth.
static void golioth_unlock(struct golioth_client *client)
int golioth_disconnect(struct golioth_client *client)
Disconnect from Golioth.
void golioth_poll_prepare(struct golioth_client *client, int64_t now, int *fd, int64_t *timeout)
Prepare for poll() system call on transport socket.
int golioth_send_hello(struct golioth_client *client)
Send Hello message to Golioth.
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.
bool golioth_is_connected(struct golioth_client *client)
Check if client is connected to Golioth.
int golioth_connect(struct golioth_client *client, const char *host, uint16_t port)
Connect to Golioth.
void golioth_init(struct golioth_client *client)
Initialize golioth client instance.
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.
golioth_content_format
Set of Content-Format option values for Golioth APIs.
@ GOLIOTH_CONTENT_FORMAT_APP_CBOR
@ GOLIOTH_CONTENT_FORMAT_APP_JSON
@ GOLIOTH_CONTENT_FORMAT_APP_OCTET_STREAM
Represents a Golioth client instance.
struct golioth_settings settings
void(* wakeup)(struct golioth_client *client)
struct k_mutex coap_reqs_lock
struct coap_packet rx_packet
void(* on_connect)(struct golioth_client *client)
Global/shared RPC state data, placed in struct golioth_client.
Settings state data, placed in struct golioth_client.
(D)TLS credentials of Golioth client.