PebbleOS
Loading...
Searching...
No Matches
Enumerations | Functions
Bluetooth control

Start, stop and reset the Bluetooth stack. More...

Enumerations

enum  BtCtlModeOverride { BtCtlModeOverrideNone , BtCtlModeOverrideStop , BtCtlModeOverrideRun }
 Override of the airplane mode setting. More...
 

Functions

void bt_ctl_init (void)
 Initialize Bluetooth control, loading the persisted airplane mode setting.
 
bool bt_ctl_is_airplane_mode_on (void)
 Get the airplane mode setting.
 
bool bt_ctl_is_bluetooth_active (void)
 Check whether the stack is supposed to be running.
 
bool bt_ctl_is_bluetooth_running (void)
 Check whether the stack is up and running.
 
void bt_ctl_set_airplane_mode_async (bool enabled)
 Set and persist airplane mode.
 
void bt_ctl_set_enabled (bool enabled)
 Enable or disable Bluetooth, as requested by the runlevel system.
 
void bt_ctl_set_override_mode (BtCtlModeOverride override)
 Set the airplane mode override.
 
void bt_ctl_reset_bluetooth (void)
 Restart the stack from KernelBG.
 

Detailed Description

Start, stop and reset the Bluetooth stack.

Enumeration Type Documentation

◆ BtCtlModeOverride

Override of the airplane mode setting.

Enumerator
BtCtlModeOverrideNone 

Follow the airplane mode setting.

BtCtlModeOverrideStop 

Keep the stack stopped.

BtCtlModeOverrideRun 

Keep the stack running regardless of airplane mode.

Function Documentation

◆ bt_ctl_init()

void bt_ctl_init ( void  )

Initialize Bluetooth control, loading the persisted airplane mode setting.

Must be called before any setter.

◆ bt_ctl_is_airplane_mode_on()

bool bt_ctl_is_airplane_mode_on ( void  )

Get the airplane mode setting.

Returns
True if airplane mode is on.

◆ bt_ctl_is_bluetooth_active()

bool bt_ctl_is_bluetooth_active ( void  )

Check whether the stack is supposed to be running.

It may not actually be running yet, e.g. while starting or resetting.

Returns
True if enabled and not stopped by airplane mode or the override.

◆ bt_ctl_is_bluetooth_running()

bool bt_ctl_is_bluetooth_running ( void  )

Check whether the stack is up and running.

Returns
True if running.

◆ bt_ctl_reset_bluetooth()

void bt_ctl_reset_bluetooth ( void  )

Restart the stack from KernelBG.

No-op if Bluetooth is not active.

◆ bt_ctl_set_airplane_mode_async()

void bt_ctl_set_airplane_mode_async ( bool  enabled)

Set and persist airplane mode.

The stack is started or stopped later from KernelBG.

Parameters
enabledTrue to turn airplane mode on.

◆ bt_ctl_set_enabled()

void bt_ctl_set_enabled ( bool  enabled)

Enable or disable Bluetooth, as requested by the runlevel system.

Starts or stops the stack synchronously as needed.

Parameters
enabledTrue to enable.

◆ bt_ctl_set_override_mode()

void bt_ctl_set_override_mode ( BtCtlModeOverride  override)

Set the airplane mode override.

Starts or stops the stack synchronously as needed.

Parameters
overrideNew override mode.