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