# File lib/nxt_comm.rb, line 274
  def recv_reply
        @@mutex.synchronize do
            while (len_header = @sp.sysread(2))
              msg = @sp.sysread(len_header.unpack("v")[0])
              puts "Received Message: #{len_header.to_hex_str}#{msg.to_hex_str}" if $DEBUG
              
              if msg[0] != 0x02
                error = "ERROR: Returned something other then a reply telegram"
                return [false,error]
              end
              
              if msg[2] != 0x00
                error = "ERROR: #{@@error_codes[msg[2]]}"
                return [false,error]
              end
              
              return [true,msg]
            end
    end
  end