Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
golioth: drop golioth_blockwise_download_init()
Browse files Browse the repository at this point in the history
This API was used internally by FW module, but is not used anymore after
rework on top of 'coap_req'.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
  • Loading branch information
mniestroj committed Oct 7, 2022
1 parent a540099 commit e81408e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
32 changes: 0 additions & 32 deletions include/net/golioth.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,38 +97,6 @@ struct golioth_client {
struct golioth_settings settings;
};

struct golioth_blockwise_download_ctx;

/**
* @typedef golioth_blockwise_download_received_t
* @brief Type of the callback being called when a single block of data is
* received as part of CoAP response.
*/
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);

/**
* @brief Represents blockwise download transfer from Golioth.
*/
struct golioth_blockwise_download_ctx {
struct coap_block_context block_ctx;
struct golioth_client *client;
struct coap_reply *reply;
uint8_t token[COAP_TOKEN_MAX_LEN];
golioth_blockwise_download_received_t received_cb;
};

/**
* @brief Initialize blockwise download
*
* @param client Client instance
* @param ctx Blockwise download context
*/
void golioth_blockwise_download_init(struct golioth_client *client,
struct golioth_blockwise_download_ctx *ctx);

static inline void golioth_lock(struct golioth_client *client)
{
k_mutex_lock(&client->lock, K_FOREVER);
Expand Down
11 changes: 0 additions & 11 deletions net/golioth/golioth.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,17 +520,6 @@ static int golioth_recv(struct golioth_client *client, uint8_t *data,
return ret;
}

void golioth_blockwise_download_init(struct golioth_client *client,
struct golioth_blockwise_download_ctx *ctx)
{
ctx->client = client;
coap_block_transfer_init(&ctx->block_ctx,
golioth_estimated_coap_block_size(client), 0);

sys_put_be32(sys_rand32_get(), &ctx->token[0]);
sys_put_be32(sys_rand32_get(), &ctx->token[4]);
}

int golioth_process_rx(struct golioth_client *client)
{
int ret;
Expand Down

0 comments on commit e81408e

Please sign in to comment.