From a5df23b56539582df2301cc513be1dfa7be87ea8 Mon Sep 17 00:00:00 2001 From: Shabirmean Date: Fri, 16 Oct 2015 16:27:42 +0530 Subject: [PATCH] changed the terminal print text in the startup script of virtual_firealarm --- modules/samples/virtual_firealarm/sketch/startservice.sh | 2 +- .../firealarm/service/impl/VirtualFireAlarmService.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/samples/virtual_firealarm/sketch/startservice.sh b/modules/samples/virtual_firealarm/sketch/startservice.sh index 2cb211ef..699e9d50 100644 --- a/modules/samples/virtual_firealarm/sketch/startservice.sh +++ b/modules/samples/virtual_firealarm/sketch/startservice.sh @@ -11,7 +11,7 @@ echo "----------------------------------------------------------------" 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 + read -p "What is the network-interface of your device that the Agent should use (find from ifconfig. ex: wlan0,en0,eth0..) > " interface echo "Setting the network-interface to " $interface sed s/^network-interface=.*/network-interface=$interface/ deviceConfig.properties > myTmp diff --git a/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/VirtualFireAlarmService.java b/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/VirtualFireAlarmService.java index 9b891606..fb24456b 100644 --- a/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/VirtualFireAlarmService.java +++ b/modules/samples/virtual_firealarm/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/VirtualFireAlarmService.java @@ -304,8 +304,8 @@ public class VirtualFireAlarmService { public Response downloadSketch(@QueryParam("owner") String owner, @QueryParam("deviceName") String customDeviceName, @PathParam("sketch_type") String sketchType) { - - ZipArchive zipFile = null; + //TODO:: null check customDeviceName at UI level + ZipArchive zipFile = null; try { zipFile = createDownloadFile(owner, customDeviceName, sketchType); Response.ResponseBuilder rb = Response.ok(zipFile.getZipFile()); @@ -391,8 +391,7 @@ public class VirtualFireAlarmService { //Register the device with CDMF String deviceName = customDeviceName + "_" + deviceId; status = register(deviceId, deviceName, owner); -// status = register(deviceId, owner + "s_" + sketchType + "_" + deviceId.substring(0, 3), -// owner); + if (!status) { String msg = "Error occurred while registering the device with " + "id: " + deviceId + " owner:" + owner;