lib/ftdi.rb
def read_data
      chunksize = read_data_chunksize
      p = FFI::MemoryPointer.new(:char, chunksize)
      bytes_read = Ftdi.ftdi_read_data(ctx, p, chunksize)
      check_result(bytes_read)
      r = p.read_bytes(bytes_read)
      r.force_encoding("ASCII-8BIT")  if r.respond_to?(:force_encoding)
      r
    end
def read_data
      chunksize = read_data_chunksize
      p = FFI::MemoryPointer.new(:char, chunksize)
      bytes_read = Ftdi.ftdi_read_data(ctx, p, chunksize)
      check_result(bytes_read)
      r = p.read_bytes(bytes_read)
      r.force_encoding("ASCII-8BIT")  if r.respond_to?(:force_encoding)
      r
    end
def read_data chunksize = read_data_chunksize p = FFI :: MemoryPointer . new ( :char , chunksize ) bytes_read = Ftdi . ftdi_read_data ( ctx , p , chunksize ) check_result ( bytes_read ) r = p . read_bytes ( bytes_read ) r . force_encoding ( "ASCII-8BIT" ) if r . respond_to? ( :force_encoding ) r end
Reads data in chunks from the chip.
 Returns when at least one byte is available or when the latency timer has elapsed.
 Automatically strips the two modem status bytes transfered during every read.
 @return [String] Bytes read; Empty string if no bytes read.
 @see #read_data_chunksize
 @raise [StatusCodeError] libftdi reports error.
Reads data in chunks from the chip . Returns when at least one byte is available or when the latency timer has elapsed . Automatically strips the two modem status bytes transfered during every read .