 
 
 
+
+
+

  unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + 512 + LWS_SEND_BUFFER_POST_PADDING];
  unsigned char *p = &buf[LWS_SEND_BUFFER_PRE_PADDING];

//  getSerialCommand(); 
//  if( !g_iNewCode )
 // {

    // OLD CODE
    Serial.println("OLD CODE");

    // Send HW status to website
    n = sprintf((char *)p, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
    g_abD[0],
    g_abD[1],
    g_abD[2],
    g_aiP[3],   // Px
    g_abD[4],
    g_aiP[5],   // Px
    g_aiP[6],   // Px
    g_abD[7],
    g_abD[8],
    g_aiP[9],   // Px
    g_aiP[10],  // Px
    g_aiP[11],  // Px
    g_abD[12],
    g_abD[13],
    analogRead(A0),
    analogRead(A1),
    analogRead(A2),
    analogRead(A3),
    analogRead(A4),
    analogRead(A5)
      );

//  }
//  else
//  {
    // NEW CODE

    ////// NEW JSON CODE /////
    /*
    updateBoardState();
    aJsonObject *msg = getJsonBoardState();

    aJson.print(msg, &serial_stream);
    Serial.println("");
    aJson.deleteItem(msg);
*/
    /*
    // Creating buffer for WebSockets
     int n;
     // unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + 512 + LWS_SEND_BUFFER_POST_PADDING];
     // unsigned char *p = &buf[LWS_SEND_BUFFER_PRE_PADDING];


static const struct serveable whitelist[] = {
  { 
    "/favicon.ico", "image/x-icon"                               }
  ,
  { 
    "/static/css/app.css", "text/css"                               }
  ,
  { 
    "/static/css/jquery.mobile-1.4.1.min.css", "text/css"                               }
  ,
  { 
    "/static/js/app.js", "application/javascript"                               }
  ,
  { 
    "/static/js/jquery.jsPlumb-1.4.1-all.js", "application/javascript"                               }
  ,
  { 
    "/static/js/jquery.mobile-1.4.1.js", "application/javascript"                               }
  ,
  { 
    "/static/js/angular.min.js", "application/javascript"                               }
  ,
  { 
    "/static/js/jquery.min.js", "application/javascript"                               }
  ,
  { 
    "/static/js/jquery-ui.min.js", "application/javascript"                               }
  ,
  { 
    "/static/js/underscore-min.js", "application/javascript"                               }
  ,

  /* last one is the default served if no match */
  { 
    "/index.html", "text/html"                               }
  ,
};


/* this protocol server (always the first one) just knows how to do HTTP */

