small corrections with firealarm sample

merge-requests/1/head
Shabir Mohamed 9 years ago
parent e7bf722c48
commit 5d0f0c9a42

@ -33,7 +33,7 @@
<![CDATA[ <![CDATA[
<datasource> <datasource>
<name>${data_source}</name> <name>${data_source}</name>
<description>The datasource used for Arduino database</description> <description>The datasource used for Firealarm database</description>
<jndiConfig> <jndiConfig>
<name>jdbc/${data_source}</name> <name>jdbc/${data_source}</name>
</jndiConfig> </jndiConfig>

@ -2,13 +2,45 @@
echo "----------------------------------------------------------------" echo "----------------------------------------------------------------"
echo "| WSO2 IOT Sample " echo "| WSO2 IOT Sample "
echo "| RaspiAlarm " echo "| Virtual RaspiAlarm "
echo "| ---------------- " echo "| ---------------- "
echo "| ....initializing startup-script " echo "| ....initializing startup-script "
echo "----------------------------------------------------------------" echo "----------------------------------------------------------------"
unzip firealarm-virtual-agent-1.0-SNAPSHOT-jar-with-dependencies.jar.zip unzip firealarm-virtual-agent-1.0-SNAPSHOT-jar-with-dependencies.jar.zip
while true; do
read -p "What is the network-interface of your PC that the Agent should use (find from ifconfig. ex: wlan0,en0,eth0..) > " interface
if [ $interface -eq $interface 2>/dev/null ]
then
echo "Setting the network-interface to " $interface
sed s/^network-interface=.*/network-interface=$interface/ deviceConfig.properties > myTmp
mv -f myTmp deviceConfig.properties
rm myTmp
break;
else
echo "Please select an appropriate interface from those which are listed on ifconfig."
fi
done
while true; do
read -p "Whats the time-interval (in seconds) between successive Data-Pushes to the WSO2-IoT-Server (ex: '60' indicates 1 minute) > " interval
if [ $interval -eq $interval 2>/dev/null ]
then
echo "Setting data-push interval to " $interval " seconds."
sed s/^push-interval=.*/push-interval=$interval/ deviceConfig.properties > myTmp
mv -f myTmp deviceConfig.properties
rm myTmp
break;
else
echo "Input needs to be an integer indicating the number seconds between successive data-pushes."
fi
done
java -jar firealarm-virtual-agent-1.0-SNAPSHOT-jar-with-dependencies.jar java -jar firealarm-virtual-agent-1.0-SNAPSHOT-jar-with-dependencies.jar

@ -51,10 +51,7 @@ import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Properties;
import java.util.UUID; import java.util.UUID;
//@Path("/FireAlarmDeviceManager") //@Path("/FireAlarmDeviceManager")
@ -303,15 +300,6 @@ public class FireAlarmManagerService {
String accessToken = accessTokenInfo.getAccess_token(); String accessToken = accessTokenInfo.getAccess_token();
String refreshToken = accessTokenInfo.getRefresh_token(); String refreshToken = accessTokenInfo.getRefresh_token();
//adding registering data //adding registering data
//
//
// Properties props = System.getProperties();
// Enumeration e = props.propertyNames();
//
// while (e.hasMoreElements()) {
// String key = (String) e.nextElement();
// log.info(key + " -- " + props.getProperty(key));
// }
XmppAccount newXmppAccount = new XmppAccount(); XmppAccount newXmppAccount = new XmppAccount();
newXmppAccount.setAccountName(owner + "_" + deviceId); newXmppAccount.setAccountName(owner + "_" + deviceId);

Loading…
Cancel
Save