Checking in working pysniffer on a RaspberryPi3 (part of IoTSec, a research system...
[iot2.git] / benchmarks / drivers / Java / DlinkAlarm / DlinkAlarm.java
index e19b37545a61cf572b2d2fe89049105eaca6b805..c1232b9b1062180d5c2aa0e7a7b92b7df1a77660 100644 (file)
@@ -100,6 +100,10 @@ public class DlinkAlarm implements Alarm {
         
         // We don't use zone at this point (for this alarm there is only 1 zone and 1 alarm)
 
+        // Send login request first
+        sendLoginRequest();
+        // Send login info (challenge and HMAC encrypted message)
+        sendLoginInfo();
         // True means on
         if (_onOff) {
             if ((_onDurationSeconds == -1) || (_onDurationSeconds > 86400)) {
@@ -169,10 +173,6 @@ public class DlinkAlarm implements Alarm {
                           "\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body>";
             // End!
             end = "</soap:Body></soap:Envelope>\r\n";
-            // Send login request first
-            sendLoginRequest();
-            // Send login info (challenge and HMAC encrypted message)
-            sendLoginInfo();
                } catch (Exception e) {
                        e.printStackTrace();
                }