Skip to content

BluetoothServer

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QBluetoothServer
PySide6.QtBluetooth
QBluetoothServer(self, serverType: PySide6.QtBluetooth.QBluetoothServiceInfo.Protocol, /, parent: PySide6.QtCore.QObject | None \= None) -> None

⋔ Inheritance diagram

graph TD
  32538212["bluetooth.BluetoothServer"]
  3227531497["core.ObjectMixin"]
  2751680898["builtins.object"]
  801411074["QtBluetooth.QBluetoothServer"]
  3984060476["QtCore.QObject"]
  37984305["Shiboken.Object"]
  3227531497 --> 32538212
  2751680898 --> 3227531497
  801411074 --> 32538212
  3984060476 --> 801411074
  37984305 --> 3984060476
  2751680898 --> 37984305

🛈 DocStrings

Bases: ObjectMixin, QBluetoothServer

Uses the RFCOMM or L2cap protocol to communicate with a Bluetooth device.

Source code in prettyqt/bluetooth/bluetoothserver.py
class BluetoothServer(core.ObjectMixin, bluetooth.QBluetoothServer):
    """Uses the RFCOMM or L2cap protocol to communicate with a Bluetooth device."""

    def __init__(
        self,
        protocol: bluetooth.bluetoothserviceinfo.ProtocolStr
        | bluetooth.QBluetoothServiceInfo.Protocol,
        parent: core.QObject | None = None,
    ):
        protocol = bluetooth.bluetoothserviceinfo.PROTOCOL.get_enum_value(protocol)
        super().__init__(protocol, parent)

    def get_error(self) -> ErrorStr:
        """Get error code."""
        return ERROR.inverse[self.error()]

    def get_server_type(self) -> bluetooth.bluetoothserviceinfo.ProtocolStr:
        """Get server type."""
        return bluetooth.bluetoothserviceinfo.PROTOCOL.inverse[self.serverType()]

    def get_server_address(self) -> bluetooth.BluetoothAddress:
        """Return bluetooth server address."""
        return bluetooth.BluetoothAddress(self.serverAddress())

get_error() -> ErrorStr

Get error code.

Source code in prettyqt/bluetooth/bluetoothserver.py
def get_error(self) -> ErrorStr:
    """Get error code."""
    return ERROR.inverse[self.error()]

get_server_address() -> bluetooth.BluetoothAddress

Return bluetooth server address.

Source code in prettyqt/bluetooth/bluetoothserver.py
def get_server_address(self) -> bluetooth.BluetoothAddress:
    """Return bluetooth server address."""
    return bluetooth.BluetoothAddress(self.serverAddress())

get_server_type() -> bluetooth.bluetoothserviceinfo.ProtocolStr

Get server type.

Source code in prettyqt/bluetooth/bluetoothserver.py
def get_server_type(self) -> bluetooth.bluetoothserviceinfo.ProtocolStr:
    """Get server type."""
    return bluetooth.bluetoothserviceinfo.PROTOCOL.inverse[self.serverType()]

:fa-brands-github: Show source on GitHub