Controlling Bluetooth on 4631

Hi,
I want to be able to turn Bluetooth off and on depending on various external criteria.
I’ve searched the BLE library and I can’t see any way of turning it off.
Thanks
Alan

There is no function to switch off Bluetooth after it is initialized in the Arduino BSP. The only thing you can do is to set the power to the minimum and stop advertising with

Bluefruit.Advertising.stop();
Bluefruit.setTxPower(0);

In RUI3 the sequence would be

api.ble.advertise.stop();
api.ble.setting.txPower.set(0);

Thanks. I’ll give that a go. I found the Bluetooth is using about 2mA - roughly half my standing current.
Alan

Theoretically though, couldn’t you call for a system reset, and then use a flag stored in non volatile memory to choose whether to start up BLE or not? In RUI this command is api.system.reboot(). That should start you with a fresh clean state and BLE initialized or not depending on your needs I believe.