   Udp.begin(DEFAULT_UDP_PORT);
   
   //device profile
-  if(root) {
-    aJson.addStringToObject(root, "devicename", "TI_cc3200_1");
-    aJson.addStringToObject(root, "componentname", "cc3200button");
-    aJson.addStringToObject(root, "protocol", "tcp");
-    aJson.addNumberToObject(root, "port", 8000);
-  }
-  
-  client = server.available();
+  if(announce) {
+    aJson.addStringToObject(announce, "devicename", "TI_cc3200_1");
+    aJson.addStringToObject(announce, "componentname", "cc3200button");
+    aJson.addStringToObject(announce, "protocol", "tcp");
+    aJson.addNumberToObject(announce, "port", 8000);
+    aJson.addStringToObject(announce, "command","auth");
+  }
+  
+  if(frame) {
+    aJson.addStringToObject(frame, "devicename", "TI_cc3200_1");
+    aJson.addStringToObject(frame, "componentname", "cc3200button");
+    aJson.addStringToObject(frame, "command","buttonread");
+    aJson.addBooleanToObject(frame, "button1", false);
+    aJson.addBooleanToObject(frame, "button2", false);
+  }
 }
 
 void loop()

volatile int green_state = LOW;

//access point should only work for b and g
char ssid[] = "nsynapse";
char password[] = "elec6887";
WiFiClient client;
WiFiServer server(8000);
WiFiUDP Udp;


  digitalWrite(RED_LED, red_state);
}


void update(unsigned char button, boolean value) 
{
  if(button==PUSH1) {
    aJsonObject* button1 = aJson.getObjectItem(frame, "button1");
    button1->valuebool = value;
  }
  
  if(button==PUSH2) {
    aJsonObject* button2 = aJson.getObjectItem(frame, "button2");
    button2->valuebool = value;
  }
}
