salt.modules.bluez

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
salt.modules.bluez.address_()

Get the many addresses of the Bluetooth adapter

CLI Example:

salt '*' bluetooth.address
salt.modules.bluez.block(bdaddr)

Block a specific bluetooth device by BD Address

CLI Example:

salt '*' bluetooth.block DE:AD:BE:EF:CA:FE
salt.modules.bluez.discoverable(dev)

Enable this bluetooth device to be discoverable.

CLI Example:

salt '*' bluetooth.discoverable hci0
salt.modules.bluez.noscan(dev)

Turn off scanning modes on this device.

CLI Example:

salt '*' bluetooth.noscan hci0
salt.modules.bluez.pair(address, key)

Pair the bluetooth adapter with a device

CLI Example:

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.

salt.modules.bluez.power(dev, mode)

Power a bluetooth device on or off

CLI Examples:

salt '*' bluetooth.power hci0 on
salt '*' bluetooth.power hci0 off
salt.modules.bluez.scan()

Scan for bluetooth devices in the area

CLI Example:

salt '*' bluetooth.scan
salt.modules.bluez.start()

Start the bluetooth service.

CLI Example:

salt '*' bluetooth.start
salt.modules.bluez.stop()

Stop the bluetooth service.

CLI Example:

salt '*' bluetooth.stop
salt.modules.bluez.unblock(bdaddr)

Unblock a specific bluetooth device by BD Address

CLI Example:

salt '*' bluetooth.unblock DE:AD:BE:EF:CA:FE
salt.modules.bluez.unpair(address)

Unpair the bluetooth adapter from a device

CLI Example:

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.

salt.modules.bluez.version()

Return Bluez version from bluetoothd -v

CLI Example:

salt '*' bluetoothd.version