(self, char_uuid)
return characteristic.handle
Look up and return the handle for an attribute by its UUID.
        :param char_uuid: The UUID of the characteristic.
        :type uuid: str
        :return: None if the UUID was not found.
Look up and return the handle for an attribute by its UUID.
        :param char_uuid: The UUID of the characteristic.
        :type uuid: str
        :return: None if the UUID was not found.
Look up and return the handle for an attribute by its UUID . : param char_uuid : The UUID of the characteristic . : type uuid : str : return : None if the UUID was not found .
def get_handle(self, char_uuid):
        """
        Look up and return the handle for an attribute by its UUID.
        :param char_uuid: The UUID of the characteristic.
        :type uuid: str
        :return: None if the UUID was not found.
        """
        if isinstance(char_uuid, string_type):
            char_uuid = UUID(char_uuid)
        log.debug("Looking up handle for characteristic %s", char_uuid)
        if char_uuid not in self._characteristics:
            self._characteristics = self.discover_characteristics()

        characteristic = self._characteristics.get(char_uuid)
        if characteristic is None:
            message = "No characteristic found matching %s" % char_uuid
            log.warn(message)
            raise exceptions.BLEError(message)

        # TODO support filtering by descriptor UUID, or maybe return the whole
        # Characteristic object
        log.debug("Found %s" % characteristic)
        return characteristic.handle
def get_handle ( self , char_uuid ) : if isinstance ( char_uuid , string_type ) : char_uuid = UUID ( char_uuid ) log . debug ( "Looking up handle for characteristic %s" , char_uuid ) if char_uuid not in self . _characteristics : self . _characteristics = self . discover_characteristics ( ) characteristic = self . _characteristics . get ( char_uuid ) if characteristic is None : message = "No characteristic found matching %s" % char_uuid log . warn ( message ) raise exceptions . BLEError ( message ) # TODO support filtering by descriptor UUID, or maybe return the whole # Characteristic object log . debug ( "Found %s" % characteristic ) return characteristic . handle