(self, handle, callback=None, indication=False,
                         wait_for_response=True)
Like subscribe() but using handle instead of uuid.

        handle -- handle as a integer of the characteristic to subscribe.
Like subscribe() but using handle instead of uuid.
Like subscribe () but using handle instead of uuid .
def subscribe_handle(self, handle, callback=None, indication=False,
                         wait_for_response=True):

        """
        Like subscribe() but using handle instead of uuid.

        handle -- handle as a integer of the characteristic to subscribe.
        """
        value_handle = handle
        characteristic_config_handle = value_handle + 1

        properties = bytearray([
            0x2 if indication else 0x1,
            0x0
        ])

        with self._lock:
            if callback is not None:
                self._callbacks[value_handle].add(callback)

            if self._subscribed_handlers.get(value_handle, None) != properties:
                self.char_write_handle(
                    characteristic_config_handle,
                    properties,
                    wait_for_response=wait_for_response
                )
                log.info("Subscribed to handle=0x%04x", value_handle)
                self._subscribed_handlers[value_handle] = properties
            else:
                log.debug("Already subscribed to handle=0x%04x", value_handle)
def subscribe_handle ( self , handle , callback = None , indication = False , wait_for_response = True ) : value_handle = handle characteristic_config_handle = value_handle + 1 properties = bytearray ( [ 0x2 if indication else 0x1 , 0x0 ] ) with self . _lock : if callback is not None : self . _callbacks [ value_handle ] . add ( callback ) if self . _subscribed_handlers . get ( value_handle , None ) != properties : self . char_write_handle ( characteristic_config_handle , properties , wait_for_response = wait_for_response ) log . info ( "Subscribed to handle=0x%04x" , value_handle ) self . _subscribed_handlers [ value_handle ] = properties else : log . debug ( "Already subscribed to handle=0x%04x" , value_handle )