Skip to content

BluetoothServer

Qt Base Class: QBluetoothServer

Signature: QBluetoothServer(self, serverType: PySide6.QtBluetooth.QBluetoothServiceInfo.Protocol, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

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

⋔ Inheritance diagram

graph TD
  1473367557072["bluetooth.BluetoothServer"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473367545360["QtBluetooth.QBluetoothServer"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473367557072
  140713234304496 --> 1473299815024
  1473367545360 --> 1473367557072
  1473288842240 --> 1473367545360
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 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()]

⌗ Property table

Qt Property Type Doc
objectName QString