diff --git a/Open_Access_Control_Ethernet.ino b/Open_Access_Control_Ethernet.ino index a75681d..f55ca7c 100644 --- a/Open_Access_Control_Ethernet.ino +++ b/Open_Access_Control_Ethernet.ino @@ -180,6 +180,7 @@ PCATTACH pcattach; // Software interrupt library const prog_uchar rebootMessage[] PROGMEM = {"AccessControlSystemRebooted"}; const prog_uchar doorChimeMessage[] PROGMEM = {"FrontDoorOpened"}; +const prog_uchar doorsunlockedMessage[] PROGMEM = {"AllDoorsUnlocked"}; const prog_uchar doorslockedMessage[] PROGMEM = {"AllDoorsRelocked"}; const prog_uchar alarmtrainMessage[] PROGMEM = {"AlarmTrainingPerformed."}; const prog_uchar privsdeniedMessage[] PROGMEM = {"AccessDeniedPrivelegedModeIsNotEnabled"}; @@ -285,30 +286,73 @@ void loop() // Main branch, runs over and ov if (c == '\n' && currentLineIsBlank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); - client.println("Content-Type: text/html"); + client.println("Cache-Control: no-store\r\nContent-Type: text/html"); client.println(); - if(readString.indexOf('?') > 0) { - client.println("hello!"); + if(readString.indexOf("?hi") > 0) { + client.println("hi"); + } + if(readString.indexOf("?s") > 0) { + int offset = readString.indexOf("?s"); + char usernum[3] = {readString[offset+2],readString[offset+3],readString[offset+4]}; + + client.print("m"); + client.println(usernum); + } + /* + if(readString.indexOf("?m") > 0) { + client.println("m"); // modify user + } + if(readString.indexOf("?a") > 0) { + client.println("a"); // all users + } + if(readString.indexOf("?r") > 0) { + client.println("r"); // remove user + } + if(readString.indexOf("?o") > 0) { + client.println("o"); // open + } + */ + if(readString.indexOf("?u") > 0) { + unlockall(); + client.println("u"); + } + if(readString.indexOf("?l") > 0) { + lockall(); + chirpAlarm(1); + client.println("l"); + } + /* + if(readString.indexOf("?1") > 0) { + client.println("1"); // disarm + } + if(readString.indexOf("?2") > 0) { + client.println("2"); // arm + } + if(readString.indexOf("?3") > 0) { + client.println("3"); // train + } + */ + if(readString.indexOf("?9") > 0) { + client.println("
");
+            client.print("Alarm armed:");
+            client.println(alarmArmed,DEC);
+            client.print("Alarm activated:");
+            client.println(alarmActivated,DEC);
+            client.print("Alarm 3:");
+            client.println(pollAlarm(3),DEC);
+            client.print("Alarm 2:");
+            client.println(pollAlarm(2),DEC);                  
+            client.print("Door 1 locked:");
+            client.println(door1Locked);                    
+            client.print("Door 2 locked:");
+            client.println(door2Locked); 
+            client.println("
"); + } + if(readString.indexOf("?e") > 0) { + client.println("e"); } - // output status - client.println("
");
-          client.print("Alarm armed:");
-          client.println(alarmArmed,DEC);
-          client.print("Alarm activated:");
-          client.println(alarmActivated,DEC);
-          client.print("Alarm 3:");
-          client.println(pollAlarm(3),DEC);
-          client.print("Alarm 2:");
-          client.println(pollAlarm(2),DEC);                  
-          client.print("Door 1 locked:");
-          client.println(door1Locked);                    
-          client.print("Door 2 locked:");
-          client.println(door2Locked); 
-          client.println("
"); - client.println("