Hi Nordic,
I add a switch to let user can manual control BT on or off.
But when I tring to set bt off, I got error 134.
Here is part of my code. I turn on BT and scan first.
if (switch and !BTisStart){
err = bt_enable(NULL);
if (err) {
debug("Bluetooth init failed (err %d)\n", err);
return;
}
err = bt_le_scan_start(&scan_param, device_found);
if (err) {
debug("Starting scanning failed (err %d)\n", err);
return;
}
BTisStart =true;
}
Then if switch off turn it off.
if (!switch && BTisStart){
err = bt_le_scan_stop();
if (err) {
debug("Stop scanning failed (err %d), BT ready : %d \n", err, bt_is_ready());
return;
}
err = bt_disable();
if (err) {
debug("Bluetooth disable failed (err %d), BT ready : %d\n", err, bt_is_ready());
return;
}
BTisStart =false;
}
But got fail like this
Bluetooth disable failed (err -134), BT ready : 1