// 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)) {
"\"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();
}
// Return time since January 1, 1970 00:00:00 UTC in seconds
return System.currentTimeMillis()/1000;
}
-
- /*public static void main(String[] args) throws Exception {
-
- String ipAddress = "192.168.1.183";
- String devicePin = "215530";
- IoTDeviceAddress iotAddress = new IoTDeviceAddress(ipAddress, 12345, 80, false, false);
- Set<IoTDeviceAddress> setAddress = new HashSet<IoTDeviceAddress>();
- setAddress.add(iotAddress);
- IoTSet<IoTDeviceAddress> iotSetAddress = new IoTSet<IoTDeviceAddress>(setAddress);
-
- DlinkAlarm alarm = new DlinkAlarm(iotSetAddress, devicePin);
- alarm.init();
- // Set alarm
- alarm.setZone(0, true, -1);
- // Set alarm
- alarm.setZone(0, false, 0);
- // Set alarm
- alarm.setZone(0, true, -1);
- // Set alarm
- alarm.setZone(0, false, 0);
- }*/
}