System.out.println("DEBUG: Initialized smartthings sensor! ID: " + sensorId + " Room ID: " + rm.getRoomID());
senDetectStatus.put(sensorId, false);
System.out.println("DEBUG: Initialized sensor detection to false!");
+ System.out.println("DEBUG: Now sensor ID is being set!");
// Initialize IoTCloud
sen.setId(sensorId++);
+ System.out.println("DEBUG: Set sensor ID to: " + sensorId + "!");
sen.registerCallback(this);
System.out.println("DEBUG: Registered sensor callback!");
} catch (Exception e) {
// Setting up router policies for HTTP/HTTPs
if (STR_ACTIVATE_SANDBOXING.equals("Yes")) {
if (strControllerName != null) {
- processJailConfig.configureProcessJailInetAddressPolicies(strControllerName, strAddress);
+ processJailConfig.configureProcessJailInetAddressPolicies(strControllerName, STR_ROUTER_ADD, strAddress);
} else {
- processJailConfig.configureProcessJailInetAddressPolicies(strHostAddress, strAddress);
+ processJailConfig.configureProcessJailInetAddressPolicies(strHostAddress, STR_ROUTER_ADD, strAddress);
}
}
routerConfig.configureRouterHTTPPolicies(STR_ROUTER_ADD, strHostAddress, strAddress);
* @param strAddress String device IP address
* @return void
*/
- public void configureProcessJailInetAddressPolicies(String strConfigHost, String strAddress) {
+ public void configureProcessJailInetAddressPolicies(String strConfigHost, String strRouterAddress, String strAddress) {
PrintWriter pwConfig = getPrintWriter(strConfigHost);
//System.out.println("\n\nDEBUG: Writing the config host address setup!!!\n\n");
+ pwConfig.println("file read /etc/resolv.conf");
+ pwConfig.println("file read /etc/hosts");
+ pwConfig.println("file read /etc/host.conf");
+ pwConfig.println("network inet dgram send " + strRouterAddress + " " + String.valueOf(53)); // TCP/UDP access through router
pwConfig.println("network inet stream connect ::ffff:" + strAddress + " " + String.valueOf(80)); // HTTP access for this address
}
file read /home/iotuser/iot2/iotjava/iotruntime/master/\*.class
file read /home/iotuser/iot2/iotjava/iotruntime/messages/\*.class
file read /home/iotuser/iot2/iotjava/iotruntime/zigbee/\*.class
+file read /home/iotuser/iot2/iotjava/iotcloud/\*.class
file read /home/iotuser/iot2/iotjava/iotruntime/resources/\*.csv
file read /home/iotuser/iot2/iotjava/iotruntime/music/\*.mp3
file read /dev/random
file read/write /home/iotuser/iot2/iotjava/iotruntime/<object-class-name>.jar
file read /home/iotuser/iot2/iotjava/iotrmi/Java/\*.class
file ioctl socket:[family=10:type=1:protocol=6] 0x541B
+file ioctl socket:[family=2:type=2:protocol=17] 0x541B
file read /home/iotuser/iot2/iotjava/iotruntime/\*.class
file read /usr/share/locale/en_GB/LC_MESSAGES/libc.mo
file create /tmp/imageio\*.tmp 0600