Skip to content

Commit

Permalink
sensor_monitor: move app_start_tasks
Browse files Browse the repository at this point in the history
The tests show that sidewalk state change callback can be called
before the tx task is fully initialized, and some events are dropped.
Move the initialization of the app_tx thread before the sidewalk starts.

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Jul 8, 2024
1 parent aa5168b commit e9b6596
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions samples/sid_end_device/src/sensor_monitoring/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,11 @@ void app_start(void)
.sub_ghz_link_config = app_get_sub_ghz_config(),
};

app_start_tasks();
sidewalk_start(&sid_ctx);
sidewalk_event_send(sidewalk_event_platform_init, NULL, NULL);
sidewalk_event_send(sidewalk_event_autostart, NULL, NULL);

app_start_tasks();

k_timer_start(&notify_timer, K_MSEC(NOTIFY_TIMER_DURATION_MS),
K_MSEC(CONFIG_SID_END_DEVICE_NOTIFY_DATA_PERIOD_MS));
}

0 comments on commit e9b6596

Please sign in to comment.