Automatic Disconnected bluetooth if the bluetooth hardware is off

hello everyone how is the Bluetooth automatically disconnected if the Bluetooth in hardware is off?

@taifun help

Yes, if you disable bluetooth, then there is no connection anymore, i.e. the connection is broken or disconnected

Taifun

image
here my code i want to if no connection bluetooth automatically disconnected then it will bluetoothscan will display

the problem is to find out, if the connection has been broken…
see also

Taifun