Skip to content

Commit

Permalink
app: allow DFU and Sidewalk to run in parallel
Browse files Browse the repository at this point in the history
remove disabling of Sidewalk when entering to DFU mode

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Nov 13, 2024
1 parent 871ea7b commit caa7305
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
4 changes: 0 additions & 4 deletions samples/sid_end_device/src/hello/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,9 @@ static void app_btn_dfu_state(uint32_t unused)
ARG_UNUSED(unused);
static bool go_to_dfu_state = true;
if (go_to_dfu_state) {
sidewalk_event_send(sidewalk_event_exit, NULL, NULL);
sidewalk_event_send(app_event_enter_dfu_mode, NULL, NULL);
application_state_working(&global_state_notifier, false);
} else {
sidewalk_event_send(app_event_exit_dfu_mode, NULL, NULL);
sidewalk_event_send(sidewalk_event_autostart, NULL, NULL);
application_state_working(&global_state_notifier, true);
}

go_to_dfu_state = !go_to_dfu_state;
Expand Down
2 changes: 0 additions & 2 deletions samples/sid_end_device/src/sensor_monitoring/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,9 @@ static void app_btn_dfu_state(uint32_t unused)
ARG_UNUSED(unused);
static bool go_to_dfu_state = true;
if (go_to_dfu_state) {
sidewalk_event_send(sidewalk_event_exit, NULL, NULL);
sidewalk_event_send(app_event_enter_dfu_mode, NULL, NULL);
} else {
sidewalk_event_send(app_event_exit_dfu_mode, NULL, NULL);
sidewalk_event_send(sidewalk_event_autostart, NULL, NULL);
}

go_to_dfu_state = !go_to_dfu_state;
Expand Down
4 changes: 2 additions & 2 deletions subsys/sal/common/sid_ifc/bt_app_callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ enum BT_id_values{
#if defined (CONFIG_SIDEWALK_DFU)
BT_ID_SMP_DFU,
#endif
_BT_ID_MAX = CONFIG_BT_ID_MAX
_BT_ID_MAX
};

BUILD_ASSERT(_BT_ID_MAX <= CONFIG_BT_ID_MAX, "Too many BT Ids! Configured limit is %d, but used %d", CONFIG_BT_ID_MAX, _BT_ID_MAX);
BUILD_ASSERT(_BT_ID_MAX <= CONFIG_BT_ID_MAX, "Too many BT Ids! increase CONFIG_BT_ID_MAX, to match _BT_ID_MAX");

#endif
4 changes: 2 additions & 2 deletions subsys/sal/sid_pal/src/sid_ble_advert.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ LOG_MODULE_REGISTER(sid_ble_advert, CONFIG_SIDEWALK_BLE_ADAPTER_LOG_LEVEL);

/* Advertising parameters. */
static struct bt_le_adv_param adv_param_fast = {
.id = CONFIG_SIDEWALK_BLE_ID,
.id = BT_ID_SIDEWALK,
.options = (AMA_ADV_OPTIONS),
.interval_min = MS_TO_INTERVAL_VAL(CONFIG_SIDEWALK_BLE_ADV_INT_FAST),
.interval_max = MS_TO_INTERVAL_VAL(CONFIG_SIDEWALK_BLE_ADV_INT_FAST +
CONFIG_SIDEWALK_BLE_ADV_INT_PRECISION),
};

static struct bt_le_adv_param adv_param_slow = {
.id = CONFIG_SIDEWALK_BLE_ID,
.id = BT_ID_SIDEWALK,
.options = (AMA_ADV_OPTIONS),
.interval_min = MS_TO_INTERVAL_VAL(CONFIG_SIDEWALK_BLE_ADV_INT_SLOW),
.interval_max = MS_TO_INTERVAL_VAL(CONFIG_SIDEWALK_BLE_ADV_INT_SLOW +
Expand Down

0 comments on commit caa7305

Please sign in to comment.