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 范例:

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

Block a specific bluetooth device by BD Address

CLI 范例:

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

Enable this bluetooth device to be discoverable.

CLI 范例:

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

Turn off scanning modes on this device.

CLI 范例:

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

Pair the bluetooth adapter with a device

CLI 范例:

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范例:

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

Scan for bluetooth devices in the area

CLI 范例:

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

Start the bluetooth service.

CLI 范例:

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

Stop the bluetooth service.

CLI 范例:

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

Unblock a specific bluetooth device by BD Address

CLI 范例:

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

Unpair the bluetooth adapter from a device

CLI 范例:

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 范例:

salt '*' bluetoothd.version