title: JAVA - Retrieve NMEA frame from a GPS Receptor -More details about RandomAccessFile WriteBytes method
body: <p>I have a GPS receptor. I retrieve all the NMEA frames captured by this one in the Eclipse console.</p>
  
  <p><strong>EDIT - This is my full class :</strong></p>
  
  <pre><code>public class GPSFrame extends Observable implements Runnable
  {
      static Thread myThread=null;
      static BufferedReader br;
      static BufferedWriter wr;
      static PrintWriter out;
      static InputStreamReader isr;
      static OutputStreamWriter osw;
      static java.io.RandomAccessFile port; 
  
  
      /**  CONSTRUCTOR **/
      public  GPSFrame()
      {    
           myThread=new Thread(this);
      }
  
      public void start()
      {
          try 
          {
              port=new java.io.RandomAccessFile("COM5","rwd");
              port.writeBytes("\r\n");
              port.writeBytes("c,31,0,0,5\r\n");
              port.writeBytes("T,1000,1\r\n");
          }
          catch (Exception e){ System.out.println("start "+e.toString()); }
          // The thread start automatically run() method
          myThread.start();
      }
  
  /**********************************************************************************************
   *************************** RETRIEVE GPS FRAMES AND SEND TO SERVEUR **************************
   **********************************************************************************************/
      public void run() 
      {
          System.out.println("lecture COM...");
          // INFINIT LOOP - GPSFrame is always listening for the GPS receptor
          for(;;)
          {
              String st = null;
              try 
              {
                  st=port.readLine();
                  String[]gpsframe=st.split(",");
  
                  /* IMPORTANT - DON'T FORGET SETCHANGED() or GPSFrame'll never
                   * notify UPDATE() ServerBoard method - We'll never see any changes */
                  setChanged();
                  notifyObservers(st);
  
              } 
              catch (IOException e){ System.out.println(e.getMessage()); }
              // Show in console
              System.out.println(st);
          }
      }   
  }
  </code></pre>
  
  <p>To do that, I searched on the net. But <strong>I don't understand the start() method</strong>. What is the signification of <strong>c</strong>, <strong>T</strong> and <strong>the number we give to writeBytes</strong> ?</p>
  
  <p>(I've also posted a question about this code, but for another reason. If you can help me, I shall be extremely grateful <a href="https://stackoverflow.com/questions/20631411/java-gps-receptor-sending-strange-encoded-frames-in-console">JAVA - GPS RECEPTOR sending strange/encoded frames in console</a>)</p>
  
  <p>Can someone enlighten me please ?</p>
  
  <p>Thanks a lot in advance ! :)</p>
  
  <p>Best regards,</p>
  
  <p>Tofuw</p>