#include <golioth/golioth_status.h>
#include <golioth/client.h>
#include <stdlib.h>
Go to the source code of this file.
◆ golioth_gateway_uplink_block()
enum golioth_status golioth_gateway_uplink_block |
( |
struct blockwise_transfer * | ctx, |
|
|
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 ) |
Send a single uplink block
Call this function for each block. For each call you must increment the block_idx
, On the final block, set is_last
to true. Block size is determined by the value of CONFIG_GOLIOTH_BLOCKWISE_DOWNLOAD_MAX_BLOCK_SIZE.
An optional callback and callback argument may be supplied. The callback will be called after the block is uploaded to provide access to status and CoAP response codes.
- Parameters
-
ctx | Block upload context used for all blocks in a related upload operation |
block_idx | The index of the block being sent |
buf | The buffer where the data for this block is located |
buf_len | The actual length of data (in bytes) for this block. This should be equal to CONFIG_GOLIOTH_BLOCKWISE_DOWNLOAD_MAX_BLOCK_SIZE for all blocks except for the final block, which may be shorter |
is_last | Set this to true if this is the last block in the upload |
set_cb | A callback that will be called after each block is sent (can be NULL) |
callback_arg | An optional user provided argument that will be passed to callback (can be NULL) |
◆ golioth_gateway_uplink_finish()
void golioth_gateway_uplink_finish |
( |
struct blockwise_transfer * | ctx | ) |
|
Finish a gateway uplink.
- Parameters
-
◆ golioth_gateway_uplink_start()
struct blockwise_transfer * golioth_gateway_uplink_start |
( |
struct golioth_client * | client | ) |
|