Golioth Firmware SDK
Loading...
Searching...
No Matches
gateway.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Golioth, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifdef __cplusplus
8extern "C"
9{
10#endif
11
12#pragma once
13
15#include <golioth/client.h>
16#include <stdlib.h>
17
18struct gateway_uplink;
19
20typedef enum golioth_status (*gateway_downlink_block_cb)(const uint8_t *data,
21 size_t len,
22 bool is_last,
23 void *arg);
24
25typedef void (*gateway_downlink_end_cb)(enum golioth_status status,
26 const struct golioth_coap_rsp_code *coap_rsp_code,
27 void *arg);
28
37struct gateway_uplink *golioth_gateway_uplink_start(struct golioth_client *client,
38 gateway_downlink_block_cb dnlk_block_cb,
39 gateway_downlink_end_cb dnlk_end_cb,
40 void *downlink_arg);
41
62enum golioth_status golioth_gateway_uplink_block(struct gateway_uplink *uplink,
63 uint32_t block_idx,
64 const uint8_t *buf,
65 size_t buf_len,
66 bool is_last,
68 void *callback_arg);
69
73void golioth_gateway_uplink_finish(struct gateway_uplink *uplink);
74
80enum golioth_status golioth_gateway_server_cert_get(struct golioth_client *client,
81 void *buf,
82 size_t *len);
83
90enum golioth_status golioth_gateway_device_cert_set(struct golioth_client *client,
91 const void *buf,
92 size_t len,
93 int32_t timeout_s);
94
95#ifdef __cplusplus
96}
97#endif
enum golioth_status golioth_gateway_device_cert_set(struct golioth_client *client, const void *buf, size_t len, int32_t timeout_s)
void golioth_gateway_uplink_finish(struct gateway_uplink *uplink)
enum golioth_status(* gateway_downlink_block_cb)(const uint8_t *data, size_t len, bool is_last, void *arg)
Definition gateway.h:20
enum golioth_status golioth_gateway_server_cert_get(struct golioth_client *client, void *buf, size_t *len)
struct gateway_uplink * golioth_gateway_uplink_start(struct golioth_client *client, gateway_downlink_block_cb dnlk_block_cb, gateway_downlink_end_cb dnlk_end_cb, void *downlink_arg)
enum golioth_status golioth_gateway_uplink_block(struct gateway_uplink *uplink, uint32_t block_idx, const uint8_t *buf, size_t buf_len, bool is_last, golioth_set_block_cb_fn set_cb, void *callback_arg)
void(* gateway_downlink_end_cb)(enum golioth_status status, const struct golioth_coap_rsp_code *coap_rsp_code, void *arg)
Definition gateway.h:25
golioth_status
void(* golioth_set_block_cb_fn)(struct golioth_client *client, enum golioth_status status, const struct golioth_coap_rsp_code *coap_rsp_code, const char *path, size_t block_size, void *arg)
Definition client.h:174
CoAP response code returned by server.
Definition client.h:53