Module Expr Str ImportFrom alias Import alias ImportFrom alias identifier Import alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad TryExcept body Import alias Assign NameStore NameLoad handlers ExceptHandler type NameLoad body Pass Assign NameStore Dict Str Str Assign NameStore Str FunctionDef arguments args defaults body Expr Str If NameLoad body Return NameLoad Return TupleLoad NameLoad Str decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Str TryExcept body Assign NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Pass Return Dict Str Str NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Dict Assign NameStore Str Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad attr Assign NameStore Str For NameStore NameLoad body If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index NameLoad Dict Str Str NameLoad Call AttributeLoad Str attr NameLoad If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str SubscriptLoad NameLoad Index Num If CompareIn Str NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Str If CompareIn Str NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotIn NameLoad Call NameLoad body Raise Call NameLoad Str If BoolOpOr CompareEq NameLoad Str CompareIs NameLoad NameLoad body Assign NameStore Str Assign NameStore Str orelse Assign NameStore Str Assign NameStore Str Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Expr Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad attr Assign NameStore Call NameLoad If CompareEq SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareNotIn NameLoad Call NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad attr Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad If CompareIn Str NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareNotIn NameLoad Call NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad attr Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad If CompareIn Str NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore ListLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Dict SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad body Raise Call NameLoad Str TryExcept body Expr Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad Str attr Call NameLoad SubscriptLoad NameLoad Index Str Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad attr Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call SubscriptLoad NameLoad Index Str Str Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call SubscriptLoad NameLoad Index Str Str Return NameLoad decorator_list
N/A N/A 
Support for Bluetooth (using BlueZ in Linux).

The following packages are required packages for this module:

    bluez >= 5.7
    bluez-libs >= 5.7
    bluez-utils >= 5.7
    pybluez >= 0.18
 __future__ absolute_import N/A logging salt.ext.six.moves shlex_quote _cmd_quote N/A salt.utils.validate.net salt.exceptions CommandExecutionError N/A log N/A N/A logging getLogger __name__ N/A HAS_PYBLUEZ False N/A N/A N/A bluetooth N/A HAS_PYBLUEZ True N/A N/A N/A ImportError N/A N/A N/A __func_alias__ N/A address_ address N/A __virtualname__ bluetooth __virtual__ N/A N/A N/A N/A N/A 
    Only load the module if bluetooth is installed
     N/A HAS_PYBLUEZ N/A N/A __virtualname__ N/A N/A False The bluetooth execution module cannot be loaded: bluetooth not installed. N/A version N/A N/A N/A N/A N/A 
    Return Bluez version from bluetoothd -v

    CLI Example:

    .. code-block:: bash

        salt '*' bluetoothd.version
     N/A cmd bluetoothctl -v N/A out N/A N/A N/A N/A __salt__ N/A cmd.run cmd splitlines N/A bluez_version N/A out N/A 0 N/A pybluez_version <= 0.18 (Unknown, but installed) N/A N/A N/A pybluez_version N/A bluetooth __version__ N/A N/A N/A Exception N/A exc N/A N/A N/A N/A Bluez PyBluez bluez_version pybluez_version N/A address_ N/A N/A N/A N/A N/A 
    Get the many addresses of the Bluetooth adapter

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.address
     N/A ret N/A N/A cmd hciconfig N/A out N/A N/A N/A N/A __salt__ N/A cmd.run cmd splitlines N/A dev N/A line out N/A N/A N/A N/A line startswith hci N/A N/A comps N/A N/A line split : N/A dev N/A comps N/A 0 N/A N/A ret N/A dev N/A device path dev N/A N/A /sys/class/bluetooth/{0} format dev N/A N/A BD Address line N/A N/A comps N/A N/A line split N/A N/A N/A ret N/A dev N/A address N/A comps N/A 2 N/A N/A DOWN line N/A N/A N/A N/A ret N/A dev N/A power off N/A N/A UP RUNNING line N/A N/A N/A N/A ret N/A dev N/A power on N/A ret N/A power N/A N/A dev mode N/A N/A N/A 
    Power a bluetooth device on or off

    CLI Examples:

    .. code-block:: bash

        salt '*' bluetooth.power hci0 on
        salt '*' bluetooth.power hci0 off
     N/A N/A dev N/A address_ N/A N/A N/A CommandExecutionError Invalid dev passed to bluetooth.power N/A N/A N/A mode on N/A mode True N/A N/A state up N/A mode on N/A N/A state down N/A mode off N/A cmd N/A N/A hciconfig {0} {1} format dev state N/A N/A N/A N/A N/A __salt__ N/A cmd.run cmd splitlines N/A info N/A address_ N/A N/A N/A N/A info N/A dev N/A power mode N/A N/A True N/A False N/A discoverable N/A N/A dev N/A N/A N/A 
    Enable this bluetooth device to be discoverable.

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.discoverable hci0
     N/A N/A dev N/A address_ N/A N/A N/A CommandExecutionError Invalid dev passed to bluetooth.discoverable N/A cmd N/A N/A hciconfig {0} iscan format dev N/A N/A N/A N/A N/A __salt__ N/A cmd.run cmd splitlines N/A cmd N/A N/A hciconfig {0} format dev N/A out N/A N/A __salt__ N/A cmd.run cmd N/A N/A UP RUNNING ISCAN out N/A N/A True N/A False N/A noscan N/A N/A dev N/A N/A N/A 
    Turn off scanning modes on this device.

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.noscan hci0
     N/A N/A dev N/A address_ N/A N/A N/A CommandExecutionError Invalid dev passed to bluetooth.noscan N/A cmd N/A N/A hciconfig {0} noscan format dev N/A N/A N/A N/A N/A __salt__ N/A cmd.run cmd splitlines N/A cmd N/A N/A hciconfig {0} format dev N/A out N/A N/A __salt__ N/A cmd.run cmd N/A N/A SCAN out N/A N/A False N/A True N/A scan N/A N/A N/A N/A N/A 
    Scan for bluetooth devices in the area

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.scan
     N/A ret N/A N/A devices N/A N/A bluetooth discover_devices lookup_names True N/A device devices N/A N/A N/A N/A ret append N/A N/A device N/A 0 N/A device N/A 1 N/A ret N/A block N/A N/A bdaddr N/A N/A N/A 
    Block a specific bluetooth device by BD Address

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.block DE:AD:BE:EF:CA:FE
     N/A N/A N/A N/A N/A N/A N/A salt utils validate net mac bdaddr N/A N/A N/A CommandExecutionError Invalid BD address passed to bluetooth.block N/A cmd N/A N/A hciconfig {0} block format bdaddr N/A N/A N/A N/A N/A __salt__ N/A cmd.run cmd splitlines N/A unblock N/A N/A bdaddr N/A N/A N/A 
    Unblock a specific bluetooth device by BD Address

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.unblock DE:AD:BE:EF:CA:FE
     N/A N/A N/A N/A N/A N/A N/A salt utils validate net mac bdaddr N/A N/A N/A CommandExecutionError Invalid BD address passed to bluetooth.unblock N/A cmd N/A N/A hciconfig {0} unblock format bdaddr N/A N/A N/A N/A N/A __salt__ N/A cmd.run cmd splitlines N/A pair N/A N/A address key N/A N/A N/A 
    Pair the bluetooth adapter with a device

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.pair DE:AD:BE:EF:CA:FE 1234

    Where DE:AD:BE:EF:CA:FE is the address of the device to pair with, and 1234
    is the passphrase.

    TODO: This function is currently broken, as the bluez-simple-agent program
    no longer ships with BlueZ >= 5.0. It needs to be refactored.
     N/A N/A N/A N/A N/A N/A N/A salt utils validate net mac address N/A N/A N/A CommandExecutionError Invalid BD address passed to bluetooth.pair N/A N/A N/A N/A int key N/A N/A N/A Exception N/A N/A N/A CommandExecutionError bluetooth.pair requires a numerical key to be used N/A addy N/A address_ N/A cmd N/A N/A echo {0} | bluez-simple-agent {1} {2} format N/A _cmd_quote N/A addy N/A device N/A _cmd_quote address N/A _cmd_quote key N/A out N/A N/A N/A N/A __salt__ N/A cmd.run cmd python_shell True splitlines N/A out N/A unpair N/A N/A address N/A N/A N/A 
    Unpair the bluetooth adapter from a device

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.unpair DE:AD:BE:EF:CA:FE

    Where DE:AD:BE:EF:CA:FE is the address of the device to unpair.

    TODO: This function is currently broken, as the bluez-simple-agent program
    no longer ships with BlueZ >= 5.0. It needs to be refactored.
     N/A N/A N/A N/A N/A N/A N/A salt utils validate net mac address N/A N/A N/A CommandExecutionError Invalid BD address passed to bluetooth.unpair N/A cmd N/A N/A bluez-test-device remove {0} format address N/A out N/A N/A N/A N/A __salt__ N/A cmd.run cmd splitlines N/A out N/A start N/A N/A N/A N/A N/A 
    Start the bluetooth service.

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.start
     N/A out N/A N/A __salt__ N/A service.start bluetooth N/A out N/A stop N/A N/A N/A N/A N/A 
    Stop the bluetooth service.

    CLI Example:

    .. code-block:: bash

        salt '*' bluetooth.stop
     N/A out N/A N/A __salt__ N/A service.stop bluetooth N/A out N/A