Skip to content

Commit e8d17ce

Browse files
committed
subsys: ble bt app differentiate disable
positive return code if something left on ble Signed-off-by: Krzysztof Taborowski <krzysztof.taborowski@nordicsemi.no>
1 parent 6438e91 commit e8d17ce

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

samples/sid_end_device/src/cli/app_dut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ void dut_event_get_option(sidewalk_ctx_t *sid, void *ctx)
173173
if (IS_LINK2_PROFILE_ID(dev_cfg.unicast_params.device_profile_id) ||
174174
IS_LINK3_PROFILE_ID(dev_cfg.unicast_params.device_profile_id)) {
175175
if (dev_cfg.unicast_params.device_profile_id == SID_LINK2_PROFILE_2) {
176-
LOG_INF("sid_option returned %d (%s); Link_profile ID: %d Wndw_cnt: %d Rx_Int = %d",
176+
LOG_INF("sid_option returned %d (%s); Link_profile ID: 0x%00x Wndw_cnt: %d Rx_Int = %d",
177177
e, SID_ERROR_T_STR(e),
178178
dev_cfg.unicast_params.device_profile_id,
179179
dev_cfg.unicast_params.rx_window_count,
180180
dev_cfg.unicast_params.unicast_window_interval
181181
.sync_rx_interval_ms);
182182
} else {
183-
LOG_INF("sid_option returned %d (%s); Link_profile ID: %d Wndw_cnt: %d",
183+
LOG_INF("sid_option returned %d (%s); Link_profile ID: 0x%00x Wndw_cnt: %d",
184184
e, SID_ERROR_T_STR(e),
185185
dev_cfg.unicast_params.device_profile_id,
186186
dev_cfg.unicast_params.rx_window_count);

subsys/sal/sid_pal/src/bt_app_callbacks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int sid_ble_bt_disable()
4242
return bt_disable();
4343
} else {
4444
bt_enable_count--;
45-
return 0;
45+
return bt_enable_count;
4646
}
4747
}
4848

subsys/sal/sid_pal/src/sid_ble_adapter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,11 @@ static sid_error_t ble_adapter_deinit(void)
443443
bt_id_reset(BT_ID_SIDEWALK, NULL, NULL);
444444
int err = sid_ble_bt_disable();
445445

446-
if (err) {
446+
if (err < 0) {
447447
LOG_ERR("BT disable failed (error %d)", err);
448448
return SID_ERROR_GENERIC;
449+
} else if (err > 0) {
450+
LOG_WRN("Sid ble disabled, but BT still runing");
449451
}
450452

451453
return SID_ERROR_NONE;

0 commit comments

Comments
 (0)