code: def read_data(self, size):
          
          result = list()
          data = ctypes.create_string_buffer(8)
          while size > 0:
              length = min(size, 8)
              n = hidapi.hid_read_timeout(self.device, data, length, 100)
              if n <= 0:
                  raise IOError(
                      'pywws.device_ctypes_hidapi.USBDevice.read_data failed')
              for i in range(n):
                  result.append(ord(data[i]))
              size -= n
          return result
docs: Receive data from the device.
  
          If the read fails for any reason, an :obj:`IOError` exception
          is raised.
  
          :param size: the number of bytes to read.
  
          :type size: int
  
          :return: the data received.
  
          :rtype: list(int)