(self, handle, value, wait_for_response=True,
                          timeout=30)
Writes a value to a given characteristic handle.

        :param handle:
        :param value:
        :param wait_for_response: If true, performs an attribute write. If
            false, sends a command and expects no acknowledgement from the
            device.
Writes a value to a given characteristic handle.
Writes a value to a given characteristic handle .
def char_write_handle(self, handle, value, wait_for_response=True,
                          timeout=30):
        """
        Writes a value to a given characteristic handle.

        :param handle:
        :param value:
        :param wait_for_response: If true, performs an attribute write. If
            false, sends a command and expects no acknowledgement from the
            device.
        """
        cmd = 'char-write-{0} 0x{1:02x} {2}'.format(
            'req' if wait_for_response else 'cmd',
            handle,
            ''.join("{0:02x}".format(byte) for byte in value),
        )

        log.debug('Sending cmd=%s', cmd)
        if wait_for_response:
            try:
                with self._receiver.event("char_written", timeout=timeout):
                    self.sendline(cmd)
            except NotificationTimeout:
                log.error("No response received", exc_info=True)
                raise
        else:
            self.sendline(cmd)

        log.info('Sent cmd=%s', cmd)
def char_write_handle ( self , handle , value , wait_for_response = True , timeout = 30 ) : cmd = 'char-write-{0} 0x{1:02x} {2}' . format ( 'req' if wait_for_response else 'cmd' , handle , '' . join ( "{0:02x}" . format ( byte ) for byte in value ) , ) log . debug ( 'Sending cmd=%s' , cmd ) if wait_for_response : try : with self . _receiver . event ( "char_written" , timeout = timeout ) : self . sendline ( cmd ) except NotificationTimeout : log . error ( "No response received" , exc_info = True ) raise else : self . sendline ( cmd ) log . info ( 'Sent cmd=%s' , cmd )