# File lib/nxt_comm.rb, line 238
  def send_and_receive(op,cmd)
    msg = [op] + cmd + [0x00]
    
    send_cmd(msg)
    ok,response = recv_reply
    
    if ok and response[1] == op
      data = response[3..response.size]
      # TODO ? if data contains a \n character, ruby seems to pass the parts before and after the \n
      # as two different parameters... we need to encode the data into a format that doesn't
      # contain any \n's and then decode it in the receiving method
      data = data.to_hex_str
    elsif !ok
      $stderr.puts response
      data = false
    else
      $stderr.puts "ERROR: Unexpected response #{response}"
      data = false
    end
    data
  end