# File lib/nxt_comm.rb, line 421
  def get_input_values(port)
    cmd = [port]
    result = send_and_receive @@op_codes["get_input_values"], cmd

    if result
      result_parts = result.from_hex_str.unpack('C5v4')
      result_parts[1] == 0x01 ? result_parts[1] = true : result_parts[1] = false
      result_parts[2] == 0x01 ? result_parts[2] = true : result_parts[2] = false

                        (7..8).each do |i|
                                # convert to signed word
                                # FIXME: is this right?
        result_parts[i] = -1*(result_parts[i]^0xffff) if result_parts[i] > 0xfff
      end

      {
        :port             => result_parts[0],
        :valid            => result_parts[1],
        :calibrated       => result_parts[2],
        :type             => result_parts[3],
        :mode             => result_parts[4],
        :value_raw        => result_parts[5],
        :value_normal     => result_parts[6],
        :value_scaled     => result_parts[7],
        :value_calibrated => result_parts[8],
      }
    else
      false
    end
  end