Merge pull request #95 from Shabirmean/IoTS-1.0.0-M1

Fixes to the VirtualFIreAlarmAgent
Ruwan 9 years ago
commit 8b8e2958ba

@ -88,8 +88,7 @@ public class FireAlarmXMPPCommunicator extends XMPPTransportHandler {
} catch (TransportHandlerException e) { } catch (TransportHandlerException e) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.warn(AgentConstants.LOG_APPENDER + log.warn(AgentConstants.LOG_APPENDER +
"Connection/Login to XMPP server at: " + server + "Connection/Login to XMPP server at: " + server + " failed");
" failed");
} }
} }
} }
@ -219,22 +218,24 @@ public class FireAlarmXMPPCommunicator extends XMPPTransportHandler {
public void disconnect() { public void disconnect() {
Runnable stopConnection = new Runnable() { Runnable stopConnection = new Runnable() {
public void run() { public void run() {
while (isConnected()) {
if ( dataPushServiceHandler != null) {
dataPushServiceHandler.cancel(true); dataPushServiceHandler.cancel(true);
}
while (isConnected()) {
connectorServiceHandler.cancel(true); connectorServiceHandler.cancel(true);
closeConnection(); closeConnection();
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.warn(AgentConstants.LOG_APPENDER + log.warn(AgentConstants.LOG_APPENDER +
"Unable to 'STOP' connection to XMPP server at: " + "Unable to 'STOP' connection to XMPP server at: " + server);
server);
} }
try { try {
Thread.sleep(timeoutInterval); Thread.sleep(timeoutInterval);
} catch (InterruptedException e1) { } catch (InterruptedException e1) {
log.error(AgentConstants.LOG_APPENDER + log.error(AgentConstants.LOG_APPENDER + "XMPP-Terminator: Thread Sleep Interrupt Exception");
"XMPP-Terminator: Thread Sleep Interrupt Exception");
} }
} }

@ -30,14 +30,14 @@
#define WLAN_SSID "SSID" // cannot be longer than 32 characters! #define WLAN_SSID "SSID" // cannot be longer than 32 characters!
#define WLAN_PASS "password" #define WLAN_PASS "password"
#define WLAN_SECURITY WLAN_SEC_WPA #define WLAN_SECURITY WLAN_SEC_WPA2
// Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2 // Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2
#define IDLE_TIMEOUT_MS 3000 #define IDLE_TIMEOUT_MS 3000
#define DEVICE_OWNER "${DEVICE_OWNER}" #define DEVICE_OWNER "${DEVICE_OWNER}"
#define DEVICE_ID "${DEVICE_ID}" #define DEVICE_ID "${DEVICE_ID}"
#define DEVICE_TOKEN "${DEVICE_TOKEN}" #define DEVICE_TOKEN "${DEVICE_TOKEN}"
#define REFRESH_DEVICE_TOKEN "${REFRESH_DEVICE_TOKEN}" #define REFRESH_DEVICE_TOKEN "${DEVICE_REFRESH_TOKEN}"
#define SERVICE_PORT 9763 #define SERVICE_PORT 9763

Loading…
Cancel
Save