Back

IsBluetoothOn

Hello World

Checks if bluetooth is enabled and on.

app.IsBluetoothOn() → boolean

See Also: CreateBluetoothSerial, DiscoverBtDevices

Example - Check Bluetooth Status

function OnStart()
{
    var status = app.IsBluetoothEnabled()
    var state = app.IsBluetoothOn();

    app.ShowPopup(
        "Bluetooth is " +
        (status ? "enabled" : "disabled") +
        (status == state ? " and " : " but ") +
        (state ? "on" : "off")
    );
}
    Copy     Copy All       Run