(func)
return wrapper
Every connection-specific function on the backend takes an instance of
    GATTToolBLEDevice as the first argument - this decorator will raise an
    exception if that device is not what the backend thinks is the currently
    connected device.
Every connection-specific function on the backend takes an instance of
    GATTToolBLEDevice as the first argument - this decorator will raise an
    exception if that device is not what the backend thinks is the currently
    connected device.
Every connection - specific function on the backend takes an instance of GATTToolBLEDevice as the first argument - this decorator will raise an exception if that device is not what the backend thinks is the currently connected device .
def at_most_one_device(func):
    """Every connection-specific function on the backend takes an instance of
    GATTToolBLEDevice as the first argument - this decorator will raise an
    exception if that device is not what the backend thinks is the currently
    connected device.
    """
    @functools.wraps(func)
    def wrapper(self, connected_device, *args, **kwargs):
        if connected_device != self._connected_device:
            raise NotConnectedError()
        return func(self, *args, **kwargs)
    return wrapper
def at_most_one_device ( func ) : @ functools . wraps ( func ) def wrapper ( self , connected_device , * args , * * kwargs ) : if connected_device != self . _connected_device : raise NotConnectedError ( ) return func ( self , * args , * * kwargs ) return wrapper