   {
     Serial.println("Client message is NULL");
   }
-  
+
   aJson.deleteItem(poMsg);
 }
 

    }
    else
    {
        aJson.addItemToObject(apoPin[i],"is_input", aJson.createFalse() );
    }

    // Populate pin's value
    aJson.addItemToObject(apoPin[i],"value", aJson.createItem( g_aPins[i].value ) );
    
    // TO DO - Add pin connections array
    aJson.addItemToObject(apoPin[i],"connections", aJson.createIntArray(iaPinConnects,0) );
    
    // Push to JSON structure
    sprintf(caPinNumBuffer,"%d",i);
    aJson.addItemToObject(poPins,caPinNumBuffer,apoPin[i]);
    
    /*
    aJson.addItemToObject(apoPin[i],"label", aJson.createItem("None") );
    aJson.addItemToObject(apoPin[i],"is_analog", aJson.createFalse() );
    aJson.addItemToObject(apoPin[i],"is_input", aJson.createFalse() );
    aJson.addItemToObject(apoPin[i],"value", aJson.createItem(0.0) );
    aJson.addItemToObject(apoPin[i],"connections", aJson.createIntArray(iaPinConnects,0) );
    sprintf(caPinNumBuffer,"%d",i);
    aJson.addItemToObject(poPins,caPinNumBuffer,apoPin[i]);
    */
  }

/*
typedef struct Pin {
  char label[PIN_LABEL_SIZE];
  boolean is_analog;
  boolean is_input;
  float value;
  boolean connections[TOTAL_NUM_OF_PINS];
} Pin;

Pin g_aPins[TOTAL_NUM_OF_PINS];
*/


  // Create CONNECTIONS
  int iaConnections[10];

    break;

  case LWS_CALLBACK_RECEIVE:

    Serial.println("Cleaning Protocol");

    // **********************************
