platypush/plugins/bluetooth/__init__.py
def send(self, data, device: str = None, port: int = None, service_uuid: str = None, service_name: str = None,
             binary: bool = False):
        """
        Send data to an active bluetooth connection

        :param data: Data to be sent
        :param device: Device address or name
        :param service_uuid: Service UUID
        :param service_name: Service name
        :param port: Port number
        :param binary: Set to true if msg is a base64-encoded binary string
        """
        from bluetooth import BluetoothError

        sock = self._get_sock(device=device, port=port, service_uuid=service_uuid, service_name=service_name,
                              connect_if_closed=True)

        if binary:
            data = base64.decodebytes(data.encode() if isinstance(data, str) else data)

        try:
            sock.send(data)
        except BluetoothError as e:
            self.close(device=device, port=port, service_uuid=service_uuid, service_name=service_name)
            raise e

        Send data to an active bluetooth connection

        :param data: Data to be sent
        :param device: Device address or name
        :param service_uuid: Service UUID
        :param service_name: Service name
        :param port: Port number
        :param binary: Set to true if msg is a base64-encoded binary string
        
Send data to an active bluetooth connection
Send data to an active bluetooth connection
def send(self, data, device: str = None, port: int = None, service_uuid: str = None, service_name: str = None,
             binary: bool = False):
        from bluetooth import BluetoothError
        sock = self._get_sock(device=device, port=port, service_uuid=service_uuid, service_name=service_name,
                              connect_if_closed=True)
        if binary:
            data = base64.decodebytes(data.encode() if isinstance(data, str) else data)
        try:
            sock.send(data)
        except BluetoothError as e:
            self.close(device=device, port=port, service_uuid=service_uuid, service_name=service_name)
            raise e
def send ( self , data , device : str = None , port : int = None , service_uuid : str = None , service_name : str = None , binary : bool = False ) : from bluetooth import BluetoothError sock = self . _get_sock ( device = device , port = port , service_uuid = service_uuid , service_name = service_name , connect_if_closed = True ) if binary : data = base64 . decodebytes ( data . encode ( ) if isinstance ( data , str ) else data ) try : sock . send ( data ) except BluetoothError as e : self . close ( device = device , port = port , service_uuid = service_uuid , service_name = service_name ) raise e
Send data to an active bluetooth connection
Send data to an active bluetooth connection
"""
        Send data to an active bluetooth connection

        :param data: Data to be sent
        :param device: Device address or name
        :param service_uuid: Service UUID
        :param service_name: Service name
        :param port: Port number
        :param binary: Set to true if msg is a base64-encoded binary string
        """
self
data
Data to be sent
Data to be sent
device
str
Device address or name
Device address or name
port
int
None
service_uuid
str
None
service_name
str
None
binary
bool
Set to true if msg is a base64-encoded binary string
Set to true if msg is a base64 - encoded binary string