bluetooth
Class info
Classes
| Name | Children | Inherits |
|---|---|---|
| BluetoothAddress prettyqt.bluetooth.bluetoothaddress Assigns an address to the Bluetooth device. |
||
| BluetoothDeviceDiscoveryAgent prettyqt.bluetooth.bluetoothdevicediscoveryagent Discovers the Bluetooth devices nearby. |
||
| BluetoothDeviceInfo prettyqt.bluetooth.bluetoothdeviceinfo Stores information about the Bluetooth device. |
||
| BluetoothHostInfo prettyqt.bluetooth.bluetoothhostinfo Encapsulates the details of a local QBluetooth device. |
||
| BluetoothLocalDevice prettyqt.bluetooth.bluetoothlocaldevice Enables access to the local Bluetooth device. |
||
| BluetoothServer prettyqt.bluetooth.bluetoothserver Uses the RFCOMM or L2cap protocol to communicate with a Bluetooth device. |
||
| BluetoothServiceDiscoveryAgent prettyqt.bluetooth.bluetoothservicediscoveryagent Enables you to query for Bluetooth services. |
||
| BluetoothServiceInfo prettyqt.bluetooth.bluetoothserviceinfo Enables access to the attributes of a Bluetooth service. |
||
| BluetoothSocket prettyqt.bluetooth.bluetoothsocket Enables connection to a Bluetooth device running a bluetooth server. |
||
| BluetoothUuid prettyqt.bluetooth.bluetoothuuid Generates a UUID for each Bluetooth service. |
🛈 DocStrings
Provides access to Bluetooth hardware.
BluetoothAddress
Bases: QBluetoothAddress
Assigns an address to the Bluetooth device.
Source code in prettyqt/bluetooth/bluetoothaddress.py
BluetoothDeviceDiscoveryAgent
Bases: ObjectMixin, QBluetoothDeviceDiscoveryAgent
Discovers the Bluetooth devices nearby.
Source code in prettyqt/bluetooth/bluetoothdevicediscoveryagent.py
get_error() -> ErrorStr
get_supported_discovery_methods() -> list[DiscoveryMethodStr]
Return a list of supported discovery methods.
start_discovery(classic: bool = True, low_energy: bool = True)
Start discovery of bluetooth devices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
classic
|
bool
|
use classic method |
True
|
low_energy
|
bool
|
use BLE mode |
True
|
Source code in prettyqt/bluetooth/bluetoothdevicediscoveryagent.py
BluetoothDeviceInfo
Bases: QBluetoothDeviceInfo
Stores information about the Bluetooth device.
Source code in prettyqt/bluetooth/bluetoothdeviceinfo.py
__bool__()
get_address() -> bluetooth.BluetoothAddress
get_device_uuid() -> bluetooth.BluetoothUuid
get_major_device_class() -> MajorDeviceClassStr
get_minor_device_class() -> str
Get minor device class.
Source code in prettyqt/bluetooth/bluetoothdeviceinfo.py
get_service_classes() -> list[ServiceClassStr]
get_service_ids() -> list[bluetooth.BluetoothUuid]
get_service_uuids() -> list[bluetooth.BluetoothUuid]
BluetoothHostInfo
Bases: QBluetoothHostInfo
Encapsulates the details of a local QBluetooth device.
Source code in prettyqt/bluetooth/bluetoothhostinfo.py
get_address() -> bluetooth.BluetoothAddress
set_address(address: bluetooth.QBluetoothAddress | int | str)
Set address to given value.
BluetoothLocalDevice
Bases: ObjectMixin, QBluetoothLocalDevice
Enables access to the local Bluetooth device.
Source code in prettyqt/bluetooth/bluetoothlocaldevice.py
__bool__()
for_all_devices() -> list[bluetooth.BluetoothHostInfo]
classmethod
get_connected_devices() -> list[bluetooth.BluetoothAddress]
get_host_mode() -> HostModeStr
get_pairing_status(address: bluetooth.QBluetoothAddress | int | str) -> PairingStr
Return pairing status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
QBluetoothAddress | int | str
|
bluetooth address |
required |
Source code in prettyqt/bluetooth/bluetoothlocaldevice.py
request_pairing(address: bluetooth.QBluetoothAddress | int | str, pairing: PairingStr | Pairing)
Request a pairing to given bluetooth address.
Source code in prettyqt/bluetooth/bluetoothlocaldevice.py
set_host_mode(mode: HostModeStr | HostMode)
Set host mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
HostModeStr | HostMode
|
host mode to use |
required |
BluetoothServer
Bases: ObjectMixin, QBluetoothServer
Uses the RFCOMM or L2cap protocol to communicate with a Bluetooth device.
Source code in prettyqt/bluetooth/bluetoothserver.py
get_error() -> ErrorStr
get_server_address() -> bluetooth.BluetoothAddress
get_server_type() -> bluetooth.bluetoothserviceinfo.ProtocolStr
BluetoothServiceDiscoveryAgent
Bases: ObjectMixin, QBluetoothServiceDiscoveryAgent
Enables you to query for Bluetooth services.
Source code in prettyqt/bluetooth/bluetoothservicediscoveryagent.py
get_discovered_services() -> list[bluetooth.BluetoothServiceInfo]
get_error() -> ErrorStr
set_remote_address(address: str | int | bluetooth.QBluetoothAddress) -> bool
Set remote address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str | int | QBluetoothAddress
|
address of the remote |
required |
Source code in prettyqt/bluetooth/bluetoothservicediscoveryagent.py
start_discovery(full: bool = False)
Start bluetooth service discovery.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
full
|
bool
|
full discovery instead of minimal discovery. |
False
|
Source code in prettyqt/bluetooth/bluetoothservicediscoveryagent.py
BluetoothServiceInfo
Bases: QBluetoothServiceInfo, MutableMapping
Enables access to the attributes of a Bluetooth service.
Also implements MutableMapping interface, can be used as a dicionary.
Source code in prettyqt/bluetooth/bluetoothserviceinfo.py
__iter__()
__setitem__(index: str | int | AttributeId, value)
Set attribute.
Source code in prettyqt/bluetooth/bluetoothserviceinfo.py
BluetoothSocket
Bases: IODeviceMixin, QBluetoothSocket
Enables connection to a Bluetooth device running a bluetooth server.
Source code in prettyqt/bluetooth/bluetoothsocket.py
BluetoothUuid
Bases: UuidMixin, QBluetoothUuid
Generates a UUID for each Bluetooth service.
Source code in prettyqt/bluetooth/bluetoothuuid.py
characteristic_to_string(characteristic: CharacteristicTypeStr | md) -> str
classmethod
Return string representation for given characteristic.
Source code in prettyqt/bluetooth/bluetoothuuid.py
descriptor_to_string(descriptor: DescriptorTypeStr | dt) -> str
classmethod
Return string representation for given descriptor.
protocol_to_string(protocol: ProtocolUuidStr | pu) -> str
classmethod
Return string representation for given protocol.
service_class_to_string(service_class: ServiceClassUuidStr | su) -> str
classmethod
Return string representation for given service class.