Skip to content

Commit

Permalink
sbdt: make sure scracth_buffer is ready before sbdt init
Browse files Browse the repository at this point in the history
One of the tests shown that there was a race condition,
and scrach buffer did not init on time before sbdt_init.
Reorder operations to make sure scrach buffer is ready.

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Jul 16, 2024
1 parent c5bbafc commit ec5b68d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion samples/sid_end_device/src/cli/sbdt_shell_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ LOG_MODULE_REGISTER(sid_sbdt_events, CONFIG_SIDEWALK_LOG_LEVEL);
void sbdt_event_init(sidewalk_ctx_t *sid, void *ctx)
{
struct sbdt_context *context = (struct sbdt_context *)ctx;
scratch_bufer_deinit();
scratch_buffer_init();
sid_error_t ret = sid_bulk_data_transfer_init(
&(struct sid_bulk_data_transfer_config){ .callbacks = &context->ft_callbacks },
sid->handle);
scratch_buffer_init();
LOG_INF("sid_bulk_data_transfer_init returned %d (%s)", ret, SID_ERROR_T_STR(ret));
}

Expand Down

0 comments on commit ec5b68d

Please sign in to comment.