Changing the alarm/siren driver - make it always authenticate when it is to make...
[iot2.git] / benchmarks / drivers / Java / DlinkAlarm / DlinkAlarm.java
index e19b37545a61cf572b2d2fe89049105eaca6b805..383d7c21ea0e928a5a954926bfc115557e9994fa 100644 (file)
@@ -47,7 +47,7 @@ public class DlinkAlarm implements Alarm {
        *******************************************************************************************************************************************/
     private static final String STR_HMAC_ALGO = "HmacMD5";
     private static final int INT_ALARM_SOUND_TYPE = 6;
-    private static final int INT_ALARM_VOLUME = 0;
+    private static final int INT_ALARM_VOLUME = 1;
     private static final int INT_ALARM_MAX_DUR = 86400;
 
     private String host = null;
@@ -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();
                }