code: def execute(self, read_response=True):
          
          # // Up- and downlink packet
          # typedef struct {
          #   uint8_t bcnt;                       // Number of bytes (cmd + payload)
          #   uint8_t cmd;                        // YSM_xxx command
          #   uint8_t payload[YSM_MAX_PKT_SIZE];  // Payload
          # } YSM_PKT;
          if self.command != pyhsm.defines.YSM_NULL:
              # YSM_NULL is the exception to the rule - it should NOT be prefixed with YSM_PKT.bcnt
              cmd_buf = struct.pack('BB', len(self.payload) + 1, self.command)
          else:
              cmd_buf = chr(self.command)
          cmd_buf += self.payload
          debug_info = None
          unlock = self.stick.acquire()
          try:
              if self.stick.debug:
                  debug_info = "%s (payload %i/0x%x)" % (pyhsm.defines.cmd2str(self.command), \
                                                          len(self.payload), len(self.payload))
              self.stick.write(cmd_buf, debug_info)
              if not read_response:
                  return None
              return self._read_response()
          finally:
              unlock()
docs: Write command to HSM and read response.
  
          @param read_response: Whether to expect a response or not.
          @type read_response: bool