summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTonyCave2013-11-28 04:26:44 -0600
committerTonyCave2013-11-28 04:26:44 -0600
commitf4aaf49f442b44c8dec3dc0271fa11ebd0d16889 (patch)
tree0f59cbff52bb8736540b3184ac5db83d94c2c3de
parent08ec139e19f58f402c26791114ace4029ba31c65 (diff)
downloadlighting-gateway-f4aaf49f442b44c8dec3dc0271fa11ebd0d16889.tar.gz
lighting-gateway-f4aaf49f442b44c8dec3dc0271fa11ebd0d16889.tar.xz
lighting-gateway-f4aaf49f442b44c8dec3dc0271fa11ebd0d16889.zip
add support for control bridge FWconrolbridge
-rwxr-xr-x[-rw-r--r--]Manifest.pdfbin185646 -> 185646 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/.classpath17
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/.project0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/.settings/org.eclipse.jdt.core.prefs0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/AndroidManifest.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/AndroidManifest.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/BuildConfig.classbin353 -> 353 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/ColourPicker.classbin8185 -> 8205 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$1.classbin2309 -> 2309 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask$1.classbin2263 -> 2263 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask.classbin4152 -> 4156 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController.classbin3327 -> 3335 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$anim.classbin601 -> 601 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$array.classbin471 -> 471 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$attr.classbin352 -> 352 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$drawable.classbin830 -> 865 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$id.classbin2365 -> 2408 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$layout.classbin638 -> 638 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$string.classbin1457 -> 1457 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$style.classbin701 -> 701 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R.classbin713 -> 713 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeAssistant.classbin12358 -> 11813 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeDevice.classbin9041 -> 9241 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeGroup.classbin1379 -> 1379 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$1.classbin707 -> 1646 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$2.classbin1044 -> 1124 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$3.classbin605 -> 1262 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$4.classbin1212 -> 1096 bytes
-rwxr-xr-xclient/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$5.classbin0 -> 911 bytes
-rwxr-xr-xclient/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$6.classbin0 -> 1091 bytes
-rwxr-xr-xclient/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$7.classbin0 -> 906 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification.classbin3966 -> 5230 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeScene.classbin1657 -> 1657 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient$1.classbin596 -> 740 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.classbin14835 -> 16040 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$1.classbin1824 -> 1824 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$2.classbin1824 -> 1824 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$3.classbin1145 -> 1145 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$4.classbin868 -> 868 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect.classbin5919 -> 6047 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$1.classbin1965 -> 1965 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$2.classbin1440 -> 1440 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$3.classbin1465 -> 1465 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$4.classbin1827 -> 1567 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$5.classbin1296 -> 1296 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$6.classbin883 -> 883 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect.classbin7530 -> 7674 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/optionsMenu.classbin522 -> 522 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$1.classbin1515 -> 1515 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$2.classbin1440 -> 1440 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$3.classbin2270 -> 2010 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$4.classbin1616 -> 1616 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$5.classbin880 -> 880 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect.classbin6402 -> 6294 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$1.classbin1109 -> 1109 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$2.classbin2725 -> 2944 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$3.classbin858 -> 858 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$4.classbin886 -> 886 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$5.classbin2105 -> 2034 bytes
-rwxr-xr-xclient/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$addDeviceTask$1.classbin0 -> 980 bytes
-rwxr-xr-xclient/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$addDeviceTask.classbin0 -> 3017 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask$1.classbin968 -> 968 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask.classbin3943 -> 4115 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain.classbin10040 -> 10923 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/default.properties0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/gen/com/lightingcontroller/BuildConfig.java0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/gen/com/lightingcontroller/R.java300
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/lint.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/proguard.cfg0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/project.properties2
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/anim/animation_enter_l.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/anim/animation_enter_r.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/anim/animation_leave_l.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/anim/animation_leave_r.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/anim/popup_in.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/anim/popup_out.xml0
-rwxr-xr-xclient/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_add.pngbin0 -> 2614 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_bind.pngbin3425 -> 3425 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_group.pngbin4167 -> 4167 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_list_devices.pngbin2006 -> 2006 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_scene.pngbin2549 -> 2549 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-hdpi/layoutborder.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-hdpi/tizllicon.bmpbin588854 -> 588854 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-ldpi/layoutborder.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-ldpi/tizllicon.bmpbin588854 -> 588854 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-mdpi/background.pngbin2047 -> 2047 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-mdpi/butt_down.9.pngbin1822 -> 1822 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-mdpi/butt_high.9.pngbin1740 -> 1740 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-mdpi/butt_norm.9.pngbin1489 -> 1489 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-mdpi/button9.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-mdpi/popup.9.pngbin1256 -> 1256 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-mdpi/tilogo.pngbin3689 -> 3689 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/drawable-mdpi/tizllicon.bmpbin588854 -> 588854 bytes
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/layout/bindview.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/layout/groupview.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/layout/main.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/layout/optionmenu.xml4
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/layout/popup.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/layout/sceneview.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/layout/zllmain.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/layout/zllmainportraite.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/values/strings.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/res/values/styles.xml0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/ColourPicker.java0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/LightingController.java2
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeAssistant.java203
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeDevice.java27
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeGroup.java0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeNotification.java475
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeScene.java0
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.java265
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/bindSelect.java8
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/groupSelect.java81
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/optionsMenu.java2
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/sceneSelect.java74
-rwxr-xr-x[-rw-r--r--]client/AndroidClients/LightingController/src/com/lightingcontroller/zllMain.java111
-rwxr-xr-x[-rw-r--r--]client/CClients/Source/socket_client.c0
-rwxr-xr-x[-rw-r--r--]client/CClients/Source/socket_client.h0
-rwxr-xr-x[-rw-r--r--]client/CClients/lightFlashCmdLine/Source/flashled.c29
-rwxr-xr-x[-rw-r--r--]client/CClients/lightFlashCmdLine/i486-linux-gnu/makefile0
-rwxr-xr-x[-rw-r--r--]client/CClients/listDevsCmdLine/Source/listdevs.c391
-rwxr-xr-x[-rw-r--r--]client/CClients/listDevsCmdLine/i486-linux-gnu/makefile0
-rwxr-xr-xclient/CClients/openNetwork/Source/openNetwork.c161
-rwxr-xr-xclient/CClients/openNetwork/i486-linux-gnu/makefile34
-rwxr-xr-xgetFwModel/getFwModel.c178
-rwxr-xr-xgetFwModel/makefile26
-rwxr-xr-xserver/Source/SimpleDB.c611
-rwxr-xr-xserver/Source/SimpleDB.h93
-rwxr-xr-xserver/Source/SimpleDBTxt.c128
-rwxr-xr-xserver/Source/SimpleDBTxt.h27
-rwxr-xr-x[-rw-r--r--]server/Source/hal_defs.h0
-rwxr-xr-x[-rw-r--r--]server/Source/hal_types.h0
-rwxr-xr-x[-rw-r--r--]server/Source/interface_devicelist.c755
-rwxr-xr-x[-rw-r--r--]server/Source/interface_devicelist.h37
-rwxr-xr-x[-rw-r--r--]server/Source/interface_grouplist.c711
-rwxr-xr-x[-rw-r--r--]server/Source/interface_grouplist.h31
-rwxr-xr-x[-rw-r--r--]server/Source/interface_scenelist.c553
-rwxr-xr-x[-rw-r--r--]server/Source/interface_scenelist.h34
-rwxr-xr-x[-rw-r--r--]server/Source/interface_srpcserver.c2029
-rwxr-xr-x[-rw-r--r--]server/Source/interface_srpcserver.h130
-rwxr-xr-x[-rw-r--r--]server/Source/socket_server.c558
-rwxr-xr-x[-rw-r--r--]server/Source/socket_server.h21
-rwxr-xr-xserver/Source/zbController.c302
-rwxr-xr-x[-rw-r--r--]server/i486-linux-gnu/Makefile8
-rwxr-xr-xzbSocDriver/zbSocCmd.c1652
-rwxr-xr-xzbSocDriver/zbSocCmd.h163
146 files changed, 6641 insertions, 3592 deletions
diff --git a/Manifest.pdf b/Manifest.pdf
index eca850e..eca850e 100644..100755
--- a/Manifest.pdf
+++ b/Manifest.pdf
Binary files differ
diff --git a/client/AndroidClients/LightingController/.classpath b/client/AndroidClients/LightingController/.classpath
index a4763d1..ce3da48 100644..100755
--- a/client/AndroidClients/LightingController/.classpath
+++ b/client/AndroidClients/LightingController/.classpath
@@ -1,8 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<classpath> 2<classpath>
3 <classpathentry kind="src" path="src"/> 3 <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
4 <classpathentry kind="src" path="gen"/> 4 <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
5 <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> 5 <classpathentry kind="src" path="src"/>
6 <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> 6 <classpathentry kind="src" path="gen"/>
7 <classpathentry kind="output" path="bin/classes"/> 7 <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
8</classpath> 8 <classpathentry kind="output" path="bin/classes"/>
9</classpath>
diff --git a/client/AndroidClients/LightingController/.project b/client/AndroidClients/LightingController/.project
index bb70ac8..bb70ac8 100644..100755
--- a/client/AndroidClients/LightingController/.project
+++ b/client/AndroidClients/LightingController/.project
diff --git a/client/AndroidClients/LightingController/.settings/org.eclipse.jdt.core.prefs b/client/AndroidClients/LightingController/.settings/org.eclipse.jdt.core.prefs
index 543e7e6..543e7e6 100644..100755
--- a/client/AndroidClients/LightingController/.settings/org.eclipse.jdt.core.prefs
+++ b/client/AndroidClients/LightingController/.settings/org.eclipse.jdt.core.prefs
diff --git a/client/AndroidClients/LightingController/AndroidManifest.xml b/client/AndroidClients/LightingController/AndroidManifest.xml
index 45fb8cd..45fb8cd 100644..100755
--- a/client/AndroidClients/LightingController/AndroidManifest.xml
+++ b/client/AndroidClients/LightingController/AndroidManifest.xml
diff --git a/client/AndroidClients/LightingController/bin/AndroidManifest.xml b/client/AndroidClients/LightingController/bin/AndroidManifest.xml
index 45fb8cd..45fb8cd 100644..100755
--- a/client/AndroidClients/LightingController/bin/AndroidManifest.xml
+++ b/client/AndroidClients/LightingController/bin/AndroidManifest.xml
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/BuildConfig.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/BuildConfig.class
index 94c5e5d..94c5e5d 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/BuildConfig.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/BuildConfig.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/ColourPicker.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/ColourPicker.class
index baa30fb..1d3a710 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/ColourPicker.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/ColourPicker.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$1.class
index fe1d34f..60b14a1 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$1.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask$1.class
index 2a6a499..2a6a499 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask$1.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask.class
index 05ccbad..0f34055 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController$waitRspTask.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController.class
index 9cdb686..aa4167b 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/LightingController.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$anim.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$anim.class
index 7c82094..7c82094 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$anim.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$anim.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$array.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$array.class
index b2d465c..b2d465c 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$array.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$array.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$attr.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$attr.class
index 7b620b3..7b620b3 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$attr.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$attr.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$drawable.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$drawable.class
index a692e54..8e6dc24 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$drawable.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$drawable.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$id.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$id.class
index 9e9ccb6..db57ba3 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$id.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$id.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$layout.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$layout.class
index 4d0f706..6353fb4 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$layout.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$layout.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$string.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$string.class
index 568ef69..c1801d9 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$string.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$string.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$style.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$style.class
index 6e491a1..d7e130e 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$style.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R$style.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R.class
index 2762b70..2762b70 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/R.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeAssistant.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeAssistant.class
index dcefaa8..832b485 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeAssistant.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeAssistant.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeDevice.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeDevice.class
index 94bd22b..a687013 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeDevice.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeDevice.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeGroup.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeGroup.class
index 8383b43..8383b43 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeGroup.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeGroup.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$1.class
index 03d1817..bea7621 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$1.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$2.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$2.class
index 57b7301..35eed7d 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$2.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$2.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$3.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$3.class
index 08bcf8e..2b3b1e6 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$3.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$3.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$4.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$4.class
index 5728e2a..0987c98 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$4.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$4.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$5.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$5.class
new file mode 100755
index 0000000..6a7610f
--- /dev/null
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$5.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$6.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$6.class
new file mode 100755
index 0000000..37ef8db
--- /dev/null
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$6.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$7.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$7.class
new file mode 100755
index 0000000..84bd686
--- /dev/null
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification$7.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification.class
index 17a40db..923a406 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeNotification.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeScene.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeScene.class
index 270063d..270063d 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeScene.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeScene.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient$1.class
index 294d077..c3e85eb 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient$1.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.class
index 6b1a6bd..0d5cb62 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$1.class
index 3fac38e..3fac38e 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$1.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$2.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$2.class
index ea283e7..ea283e7 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$2.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$2.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$3.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$3.class
index daae256..daae256 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$3.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$3.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$4.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$4.class
index bdf92dd..bdf92dd 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$4.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect$4.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect.class
index 13c417c..a41989a 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/bindSelect.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$1.class
index 1e5b0ef..882dada 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$1.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$2.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$2.class
index 953fcd2..87de90d 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$2.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$2.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$3.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$3.class
index e5da882..4d427dc 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$3.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$3.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$4.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$4.class
index 3ee9217..012da77 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$4.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$4.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$5.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$5.class
index a284f8f..880bfb7 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$5.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$5.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$6.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$6.class
index b3a3b27..94a3e65 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$6.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect$6.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect.class
index 8e54580..bd8ce1d 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/groupSelect.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/optionsMenu.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/optionsMenu.class
index ee6acd3..ee6acd3 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/optionsMenu.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/optionsMenu.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$1.class
index b94c549..794d8ff 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$1.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$2.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$2.class
index 67a9bf5..c9b509b 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$2.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$2.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$3.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$3.class
index 9c9591b..8a66c1c 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$3.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$3.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$4.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$4.class
index 1def5cd..49f39ca 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$4.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$4.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$5.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$5.class
index b2270eb..861ee15 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$5.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect$5.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect.class
index 35a0da8..9b8d0f8 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/sceneSelect.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$1.class
index ed819a7..fc3af5a 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$1.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$2.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$2.class
index c79b064..620f2d2 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$2.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$2.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$3.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$3.class
index 4a45b81..ac26807 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$3.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$3.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$4.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$4.class
index 55eb520..6c88c01 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$4.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$4.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$5.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$5.class
index 6c06c87..c2bf6ed 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$5.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$5.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$addDeviceTask$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$addDeviceTask$1.class
new file mode 100755
index 0000000..edcc641
--- /dev/null
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$addDeviceTask$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$addDeviceTask.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$addDeviceTask.class
new file mode 100755
index 0000000..d462643
--- /dev/null
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$addDeviceTask.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask$1.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask$1.class
index be8981b..4071416 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask$1.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask$1.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask.class
index 12496d8..eff697c 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain$waitRspTask.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain.class b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain.class
index 1f0dfad..ab55b41 100644..100755
--- a/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain.class
+++ b/client/AndroidClients/LightingController/bin/classes/com/lightingcontroller/zllMain.class
Binary files differ
diff --git a/client/AndroidClients/LightingController/default.properties b/client/AndroidClients/LightingController/default.properties
index f049142..f049142 100644..100755
--- a/client/AndroidClients/LightingController/default.properties
+++ b/client/AndroidClients/LightingController/default.properties
diff --git a/client/AndroidClients/LightingController/gen/com/lightingcontroller/BuildConfig.java b/client/AndroidClients/LightingController/gen/com/lightingcontroller/BuildConfig.java
index 90eed7d..90eed7d 100644..100755
--- a/client/AndroidClients/LightingController/gen/com/lightingcontroller/BuildConfig.java
+++ b/client/AndroidClients/LightingController/gen/com/lightingcontroller/BuildConfig.java
diff --git a/client/AndroidClients/LightingController/gen/com/lightingcontroller/R.java b/client/AndroidClients/LightingController/gen/com/lightingcontroller/R.java
index 9a7c7b9..9e0e0d6 100644..100755
--- a/client/AndroidClients/LightingController/gen/com/lightingcontroller/R.java
+++ b/client/AndroidClients/LightingController/gen/com/lightingcontroller/R.java
@@ -1,149 +1,151 @@
1/* AUTO-GENERATED FILE. DO NOT MODIFY. 1/* AUTO-GENERATED FILE. DO NOT MODIFY.
2 * 2 *
3 * This class was automatically generated by the 3 * This class was automatically generated by the
4 * aapt tool from the resource data it found. It 4 * aapt tool from the resource data it found. It
5 * should not be modified by hand. 5 * should not be modified by hand.
6 */ 6 */
7 7
8package com.lightingcontroller; 8package com.lightingcontroller;
9 9
10public final class R { 10public final class R {
11 public static final class anim { 11 public static final class anim {
12 public static final int animation_enter_l=0x7f040000; 12 public static final int animation_enter_l=0x7f040000;
13 public static final int animation_enter_r=0x7f040001; 13 public static final int animation_enter_r=0x7f040001;
14 public static final int animation_leave_l=0x7f040002; 14 public static final int animation_leave_l=0x7f040002;
15 public static final int animation_leave_r=0x7f040003; 15 public static final int animation_leave_r=0x7f040003;
16 public static final int popup_in=0x7f040004; 16 public static final int popup_in=0x7f040004;
17 public static final int popup_out=0x7f040005; 17 public static final int popup_out=0x7f040005;
18 } 18 }
19 public static final class array { 19 public static final class array {
20 public static final int BUAD_Rate=0x7f060001; 20 public static final int BUAD_Rate=0x7f060001;
21 public static final int OSC=0x7f060000; 21 public static final int OSC=0x7f060000;
22 public static final int Parity_Check=0x7f060002; 22 public static final int Parity_Check=0x7f060002;
23 } 23 }
24 public static final class attr { 24 public static final class attr {
25 } 25 }
26 public static final class drawable { 26 public static final class drawable {
27 public static final int background=0x7f020000; 27 public static final int background=0x7f020000;
28 public static final int butt_down=0x7f020001; 28 public static final int butt_down=0x7f020001;
29 public static final int butt_high=0x7f020002; 29 public static final int butt_high=0x7f020002;
30 public static final int butt_norm=0x7f020003; 30 public static final int butt_norm=0x7f020003;
31 public static final int button9=0x7f020004; 31 public static final int button9=0x7f020004;
32 public static final int ic_menu_bind=0x7f020005; 32 public static final int ic_menu_add=0x7f020005;
33 public static final int ic_menu_group=0x7f020006; 33 public static final int ic_menu_bind=0x7f020006;
34 public static final int ic_menu_list_devices=0x7f020007; 34 public static final int ic_menu_group=0x7f020007;
35 public static final int ic_menu_scene=0x7f020008; 35 public static final int ic_menu_list_devices=0x7f020008;
36 public static final int layoutborder=0x7f020009; 36 public static final int ic_menu_scene=0x7f020009;
37 public static final int popup=0x7f02000a; 37 public static final int layoutborder=0x7f02000a;
38 public static final int tilogo=0x7f02000b; 38 public static final int popup=0x7f02000b;
39 public static final int tizllicon=0x7f02000c; 39 public static final int tilogo=0x7f02000c;
40 } 40 public static final int tizllicon=0x7f02000d;
41 public static final class id { 41 }
42 public static final int FrameLable03=0x7f080033; 42 public static final class id {
43 public static final int FrameLable04=0x7f080028; 43 public static final int FrameLable03=0x7f080034;
44 public static final int FrameLable06=0x7f08000c; 44 public static final int FrameLable04=0x7f080029;
45 public static final int IdControlledToggle=0x7f080009; 45 public static final int FrameLable06=0x7f08000c;
46 public static final int IdControlledToggleText=0x7f08000a; 46 public static final int IdControlledToggle=0x7f080009;
47 public static final int IdControllingToggle=0x7f080006; 47 public static final int IdControlledToggleText=0x7f08000a;
48 public static final int IdControllingToggleText=0x7f080007; 48 public static final int IdControllingToggle=0x7f080006;
49 public static final int IdGroupToggle=0x7f080018; 49 public static final int IdControllingToggleText=0x7f080007;
50 public static final int IdGroupToggleText=0x7f080019; 50 public static final int IdGroupToggle=0x7f080018;
51 public static final int IdLightToggle=0x7f080016; 51 public static final int IdGroupToggleText=0x7f080019;
52 public static final int IdLightToggleText=0x7f080017; 52 public static final int IdLightToggle=0x7f080016;
53 public static final int addToGroupRadio=0x7f080013; 53 public static final int IdLightToggleText=0x7f080017;
54 public static final int bindRadio=0x7f08000b; 54 public static final int addToGroupRadio=0x7f080013;
55 public static final int colourPick=0x7f08002e; 55 public static final int bindRadio=0x7f08000b;
56 public static final int controlFrame=0x7f08002c; 56 public static final int colourPick=0x7f08002f;
57 public static final int controlledDeviceSpinner=0x7f080004; 57 public static final int controlFrame=0x7f08002d;
58 public static final int controllingDeviceSpinner=0x7f080002; 58 public static final int controlledDeviceSpinner=0x7f080004;
59 public static final int deviceChangeNameButton=0x7f08000f; 59 public static final int controllingDeviceSpinner=0x7f080002;
60 public static final int deviceFrame=0x7f08002a; 60 public static final int deviceChangeNameButton=0x7f08000f;
61 public static final int deviceIdLayout=0x7f080005; 61 public static final int deviceFrame=0x7f08002b;
62 public static final int deviceSpinner=0x7f08000e; 62 public static final int deviceIdLayout=0x7f080005;
63 public static final int groupIdLayout=0x7f080008; 63 public static final int deviceSpinner=0x7f08000e;
64 public static final int groupSpinner=0x7f080011; 64 public static final int groupIdLayout=0x7f080008;
65 public static final int image=0x7f08001f; 65 public static final int groupSpinner=0x7f080011;
66 public static final int lightIdLayout=0x7f080015; 66 public static final int image=0x7f080020;
67 public static final int linearLayout1=0x7f08002d; 67 public static final int lightIdLayout=0x7f080015;
68 public static final int linearLayout1a=0x7f08002f; 68 public static final int linearLayout1=0x7f08002e;
69 public static final int linearLayout3=0x7f08002b; 69 public static final int linearLayout1a=0x7f080030;
70 public static final int linearLayout4=0x7f080021; 70 public static final int linearLayout3=0x7f08002c;
71 public static final int linearLayout6=0x7f080000; 71 public static final int linearLayout4=0x7f080022;
72 public static final int newGroupRadio=0x7f080012; 72 public static final int linearLayout6=0x7f080000;
73 public static final int newSceneRadio=0x7f080025; 73 public static final int newGroupRadio=0x7f080012;
74 public static final int offButton=0x7f080030; 74 public static final int newSceneRadio=0x7f080026;
75 public static final int onButton=0x7f080032; 75 public static final int offButton=0x7f080031;
76 public static final int optionMenuBinding=0x7f08001c; 76 public static final int onButton=0x7f080033;
77 public static final int optionMenuGroups=0x7f08001a; 77 public static final int optionMenuAddDevice=0x7f08001a;
78 public static final int optionMenuListDevices=0x7f08001d; 78 public static final int optionMenuBinding=0x7f08001d;
79 public static final int optionMenuScenes=0x7f08001b; 79 public static final int optionMenuGroups=0x7f08001b;
80 public static final int popup_text_box=0x7f080020; 80 public static final int optionMenuListDevices=0x7f08001e;
81 public static final int radioGroup2=0x7f080024; 81 public static final int optionMenuScenes=0x7f08001c;
82 public static final int sceneRadio0=0x7f080014; 82 public static final int popup_text_box=0x7f080021;
83 public static final int sceneRestoreRadio=0x7f080027; 83 public static final int radioGroup2=0x7f080025;
84 public static final int sceneSelectSpinner=0x7f080023; 84 public static final int sceneRadio0=0x7f080014;
85 public static final int sceneStoreRadio=0x7f080026; 85 public static final int sceneRestoreRadio=0x7f080028;
86 public static final int seekBarLevel=0x7f080031; 86 public static final int sceneSelectSpinner=0x7f080024;
87 public static final int textViewControl=0x7f080001; 87 public static final int sceneStoreRadio=0x7f080027;
88 public static final int textViewControlled=0x7f080003; 88 public static final int seekBarLevel=0x7f080032;
89 public static final int textViewDev=0x7f08000d; 89 public static final int textViewControl=0x7f080001;
90 public static final int textViewGroup=0x7f080010; 90 public static final int textViewControlled=0x7f080003;
91 public static final int textViewScene=0x7f080022; 91 public static final int textViewDev=0x7f08000d;
92 public static final int toast_layout_root=0x7f08001e; 92 public static final int textViewGroup=0x7f080010;
93 public static final int zllMainLayout=0x7f080029; 93 public static final int textViewScene=0x7f080023;
94 } 94 public static final int toast_layout_root=0x7f08001f;
95 public static final class layout { 95 public static final int zllMainLayout=0x7f08002a;
96 public static final int bindview=0x7f030000; 96 }
97 public static final int groupview=0x7f030001; 97 public static final class layout {
98 public static final int main=0x7f030002; 98 public static final int bindview=0x7f030000;
99 public static final int optionmenu=0x7f030003; 99 public static final int groupview=0x7f030001;
100 public static final int popup=0x7f030004; 100 public static final int main=0x7f030002;
101 public static final int sceneview=0x7f030005; 101 public static final int optionmenu=0x7f030003;
102 public static final int zllmain=0x7f030006; 102 public static final int popup=0x7f030004;
103 public static final int zllmainportraite=0x7f030007; 103 public static final int sceneview=0x7f030005;
104 } 104 public static final int zllmain=0x7f030006;
105 public static final class string { 105 public static final int zllmainportraite=0x7f030007;
106 public static final int SelectDevice=0x7f050018; 106 }
107 public static final int SelectGroup=0x7f050019; 107 public static final class string {
108 public static final int app_name=0x7f050001; 108 public static final int SelectDevice=0x7f050018;
109 public static final int bt_ConfigInitial=0x7f05000d; 109 public static final int SelectGroup=0x7f050019;
110 public static final int bt_startrecv=0x7f05000e; 110 public static final int app_name=0x7f050001;
111 public static final int bt_startsend=0x7f050010; 111 public static final int bt_ConfigInitial=0x7f05000d;
112 public static final int bt_stoprecv=0x7f05000f; 112 public static final int bt_startrecv=0x7f05000e;
113 public static final int bt_stopsend=0x7f050011; 113 public static final int bt_startsend=0x7f050010;
114 public static final int groupAdd=0x7f05001a; 114 public static final int bt_stoprecv=0x7f05000f;
115 public static final int hello=0x7f050000; 115 public static final int bt_stopsend=0x7f050011;
116 public static final int lb_BaudRate=0x7f050004; 116 public static final int groupAdd=0x7f05001a;
117 public static final int lb_SendData=0x7f050003; 117 public static final int hello=0x7f050000;
118 public static final int lb_osc=0x7f050005; 118 public static final int lb_BaudRate=0x7f050004;
119 public static final int lb_paritycheck=0x7f050006; 119 public static final int lb_SendData=0x7f050003;
120 public static final int m_about=0x7f05000b; 120 public static final int lb_osc=0x7f050005;
121 public static final int m_clear=0x7f05000a; 121 public static final int lb_paritycheck=0x7f050006;
122 public static final int m_configinitial=0x7f050007; 122 public static final int m_about=0x7f05000b;
123 public static final int m_quit=0x7f05000c; 123 public static final int m_clear=0x7f05000a;
124 public static final int m_recvdata=0x7f050009; 124 public static final int m_configinitial=0x7f050007;
125 public static final int m_senddata=0x7f050008; 125 public static final int m_quit=0x7f05000c;
126 public static final int optionMenuGroupsTitle=0x7f05001c; 126 public static final int m_recvdata=0x7f050009;
127 public static final int optionMenuTitle=0x7f05001b; 127 public static final int m_senddata=0x7f050008;
128 public static final int optionMuneBindingTitle=0x7f05001d; 128 public static final int optionMenuGroupsTitle=0x7f05001c;
129 public static final int optionMuneListDevicesTitle=0x7f05001e; 129 public static final int optionMenuTitle=0x7f05001b;
130 public static final int rbt_0=0x7f050012; 130 public static final int optionMuneBindingTitle=0x7f05001d;
131 public static final int rbt_1=0x7f050013; 131 public static final int optionMuneListDevicesTitle=0x7f05001e;
132 public static final int rbt_2=0x7f050014; 132 public static final int rbt_0=0x7f050012;
133 public static final int rbt_3=0x7f050015; 133 public static final int rbt_1=0x7f050013;
134 public static final int rbt_4=0x7f050016; 134 public static final int rbt_2=0x7f050014;
135 public static final int str_sendtext=0x7f050017; 135 public static final int rbt_3=0x7f050015;
136 public static final int textviewMSG=0x7f050002; 136 public static final int rbt_4=0x7f050016;
137 } 137 public static final int str_sendtext=0x7f050017;
138 public static final class style { 138 public static final int textviewMSG=0x7f050002;
139 public static final int Animation_Popup=0x7f070008; 139 }
140 public static final int ApplicationTheme=0x7f070000; 140 public static final class style {
141 public static final int DialogMenuText=0x7f070007; 141 public static final int Animation_Popup=0x7f070008;
142 public static final int SideMenuText=0x7f070006; 142 public static final int ApplicationTheme=0x7f070000;
143 public static final int StdButton=0x7f070001; 143 public static final int DialogMenuText=0x7f070007;
144 public static final int StdButtonIcon=0x7f070002; 144 public static final int SideMenuText=0x7f070006;
145 public static final int StdButtonText=0x7f070003; 145 public static final int StdButton=0x7f070001;
146 public static final int StdScreen=0x7f070005; 146 public static final int StdButtonIcon=0x7f070002;
147 public static final int TitleText=0x7f070004; 147 public static final int StdButtonText=0x7f070003;
148 } 148 public static final int StdScreen=0x7f070005;
149} 149 public static final int TitleText=0x7f070004;
150 }
151}
diff --git a/client/AndroidClients/LightingController/lint.xml b/client/AndroidClients/LightingController/lint.xml
index ee0eead..ee0eead 100644..100755
--- a/client/AndroidClients/LightingController/lint.xml
+++ b/client/AndroidClients/LightingController/lint.xml
diff --git a/client/AndroidClients/LightingController/proguard.cfg b/client/AndroidClients/LightingController/proguard.cfg
index b1cdf17..b1cdf17 100644..100755
--- a/client/AndroidClients/LightingController/proguard.cfg
+++ b/client/AndroidClients/LightingController/proguard.cfg
diff --git a/client/AndroidClients/LightingController/project.properties b/client/AndroidClients/LightingController/project.properties
index f049142..c4f09d2 100644..100755
--- a/client/AndroidClients/LightingController/project.properties
+++ b/client/AndroidClients/LightingController/project.properties
@@ -8,4 +8,4 @@
8# project structure. 8# project structure.
9 9
10# Project target. 10# Project target.
11target=android-10 11target=android-17
diff --git a/client/AndroidClients/LightingController/res/anim/animation_enter_l.xml b/client/AndroidClients/LightingController/res/anim/animation_enter_l.xml
index 2ae2e85..2ae2e85 100644..100755
--- a/client/AndroidClients/LightingController/res/anim/animation_enter_l.xml
+++ b/client/AndroidClients/LightingController/res/anim/animation_enter_l.xml
diff --git a/client/AndroidClients/LightingController/res/anim/animation_enter_r.xml b/client/AndroidClients/LightingController/res/anim/animation_enter_r.xml
index 3135e3f..3135e3f 100644..100755
--- a/client/AndroidClients/LightingController/res/anim/animation_enter_r.xml
+++ b/client/AndroidClients/LightingController/res/anim/animation_enter_r.xml
diff --git a/client/AndroidClients/LightingController/res/anim/animation_leave_l.xml b/client/AndroidClients/LightingController/res/anim/animation_leave_l.xml
index 43fc169..43fc169 100644..100755
--- a/client/AndroidClients/LightingController/res/anim/animation_leave_l.xml
+++ b/client/AndroidClients/LightingController/res/anim/animation_leave_l.xml
diff --git a/client/AndroidClients/LightingController/res/anim/animation_leave_r.xml b/client/AndroidClients/LightingController/res/anim/animation_leave_r.xml
index 2ea3679..2ea3679 100644..100755
--- a/client/AndroidClients/LightingController/res/anim/animation_leave_r.xml
+++ b/client/AndroidClients/LightingController/res/anim/animation_leave_r.xml
diff --git a/client/AndroidClients/LightingController/res/anim/popup_in.xml b/client/AndroidClients/LightingController/res/anim/popup_in.xml
index e4a81a7..e4a81a7 100644..100755
--- a/client/AndroidClients/LightingController/res/anim/popup_in.xml
+++ b/client/AndroidClients/LightingController/res/anim/popup_in.xml
diff --git a/client/AndroidClients/LightingController/res/anim/popup_out.xml b/client/AndroidClients/LightingController/res/anim/popup_out.xml
index c836a1d..c836a1d 100644..100755
--- a/client/AndroidClients/LightingController/res/anim/popup_out.xml
+++ b/client/AndroidClients/LightingController/res/anim/popup_out.xml
diff --git a/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_add.png b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_add.png
new file mode 100755
index 0000000..3fa5552
--- /dev/null
+++ b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_add.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_bind.png b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_bind.png
index 26f8634..26f8634 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_bind.png
+++ b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_bind.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_group.png b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_group.png
index 8a09995..8a09995 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_group.png
+++ b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_group.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_list_devices.png b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_list_devices.png
index c028b9b..c028b9b 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_list_devices.png
+++ b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_list_devices.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_scene.png b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_scene.png
index 24680db..24680db 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_scene.png
+++ b/client/AndroidClients/LightingController/res/drawable-hdpi/ic_menu_scene.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-hdpi/layoutborder.xml b/client/AndroidClients/LightingController/res/drawable-hdpi/layoutborder.xml
index c6f17c0..c6f17c0 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-hdpi/layoutborder.xml
+++ b/client/AndroidClients/LightingController/res/drawable-hdpi/layoutborder.xml
diff --git a/client/AndroidClients/LightingController/res/drawable-hdpi/tizllicon.bmp b/client/AndroidClients/LightingController/res/drawable-hdpi/tizllicon.bmp
index 4865c01..4865c01 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-hdpi/tizllicon.bmp
+++ b/client/AndroidClients/LightingController/res/drawable-hdpi/tizllicon.bmp
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-ldpi/layoutborder.xml b/client/AndroidClients/LightingController/res/drawable-ldpi/layoutborder.xml
index 5ccef86..5ccef86 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-ldpi/layoutborder.xml
+++ b/client/AndroidClients/LightingController/res/drawable-ldpi/layoutborder.xml
diff --git a/client/AndroidClients/LightingController/res/drawable-ldpi/tizllicon.bmp b/client/AndroidClients/LightingController/res/drawable-ldpi/tizllicon.bmp
index 4865c01..4865c01 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-ldpi/tizllicon.bmp
+++ b/client/AndroidClients/LightingController/res/drawable-ldpi/tizllicon.bmp
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-mdpi/background.png b/client/AndroidClients/LightingController/res/drawable-mdpi/background.png
index 6ab5e01..6ab5e01 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-mdpi/background.png
+++ b/client/AndroidClients/LightingController/res/drawable-mdpi/background.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-mdpi/butt_down.9.png b/client/AndroidClients/LightingController/res/drawable-mdpi/butt_down.9.png
index c9047bb..c9047bb 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-mdpi/butt_down.9.png
+++ b/client/AndroidClients/LightingController/res/drawable-mdpi/butt_down.9.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-mdpi/butt_high.9.png b/client/AndroidClients/LightingController/res/drawable-mdpi/butt_high.9.png
index ba40527..ba40527 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-mdpi/butt_high.9.png
+++ b/client/AndroidClients/LightingController/res/drawable-mdpi/butt_high.9.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-mdpi/butt_norm.9.png b/client/AndroidClients/LightingController/res/drawable-mdpi/butt_norm.9.png
index 3e42a60..3e42a60 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-mdpi/butt_norm.9.png
+++ b/client/AndroidClients/LightingController/res/drawable-mdpi/butt_norm.9.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-mdpi/button9.xml b/client/AndroidClients/LightingController/res/drawable-mdpi/button9.xml
index efc7c1e..efc7c1e 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-mdpi/button9.xml
+++ b/client/AndroidClients/LightingController/res/drawable-mdpi/button9.xml
diff --git a/client/AndroidClients/LightingController/res/drawable-mdpi/popup.9.png b/client/AndroidClients/LightingController/res/drawable-mdpi/popup.9.png
index 5f6e24d..5f6e24d 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-mdpi/popup.9.png
+++ b/client/AndroidClients/LightingController/res/drawable-mdpi/popup.9.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-mdpi/tilogo.png b/client/AndroidClients/LightingController/res/drawable-mdpi/tilogo.png
index 1da4b85..1da4b85 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-mdpi/tilogo.png
+++ b/client/AndroidClients/LightingController/res/drawable-mdpi/tilogo.png
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/drawable-mdpi/tizllicon.bmp b/client/AndroidClients/LightingController/res/drawable-mdpi/tizllicon.bmp
index 4865c01..4865c01 100644..100755
--- a/client/AndroidClients/LightingController/res/drawable-mdpi/tizllicon.bmp
+++ b/client/AndroidClients/LightingController/res/drawable-mdpi/tizllicon.bmp
Binary files differ
diff --git a/client/AndroidClients/LightingController/res/layout/bindview.xml b/client/AndroidClients/LightingController/res/layout/bindview.xml
index 382791d..382791d 100644..100755
--- a/client/AndroidClients/LightingController/res/layout/bindview.xml
+++ b/client/AndroidClients/LightingController/res/layout/bindview.xml
diff --git a/client/AndroidClients/LightingController/res/layout/groupview.xml b/client/AndroidClients/LightingController/res/layout/groupview.xml
index 73c93c0..73c93c0 100644..100755
--- a/client/AndroidClients/LightingController/res/layout/groupview.xml
+++ b/client/AndroidClients/LightingController/res/layout/groupview.xml
diff --git a/client/AndroidClients/LightingController/res/layout/main.xml b/client/AndroidClients/LightingController/res/layout/main.xml
index df10bf5..df10bf5 100644..100755
--- a/client/AndroidClients/LightingController/res/layout/main.xml
+++ b/client/AndroidClients/LightingController/res/layout/main.xml
diff --git a/client/AndroidClients/LightingController/res/layout/optionmenu.xml b/client/AndroidClients/LightingController/res/layout/optionmenu.xml
index 3a9f65b..29973bf 100644..100755
--- a/client/AndroidClients/LightingController/res/layout/optionmenu.xml
+++ b/client/AndroidClients/LightingController/res/layout/optionmenu.xml
@@ -4,6 +4,8 @@
4 android:layout_height="wrap_content" 4 android:layout_height="wrap_content"
5 android:maxRows="1" 5 android:maxRows="1"
6 android:maxItemsPerRow="6" > 6 android:maxItemsPerRow="6" >
7 <item android:id="@+id/optionMenuAddDevice"
8 android:icon="@drawable/ic_menu_add" />
7 <item android:id="@+id/optionMenuGroups" 9 <item android:id="@+id/optionMenuGroups"
8 android:icon="@drawable/ic_menu_group" /> 10 android:icon="@drawable/ic_menu_group" />
9 <item android:id="@+id/optionMenuScenes" 11 <item android:id="@+id/optionMenuScenes"
@@ -11,5 +13,5 @@
11 <item android:id="@+id/optionMenuBinding" 13 <item android:id="@+id/optionMenuBinding"
12 android:icon="@drawable/ic_menu_bind" /> 14 android:icon="@drawable/ic_menu_bind" />
13 <item android:id="@+id/optionMenuListDevices" 15 <item android:id="@+id/optionMenuListDevices"
14 android:icon="@drawable/ic_menu_list_devices" /> 16 android:icon="@drawable/ic_menu_list_devices" />
15</menu> 17</menu>
diff --git a/client/AndroidClients/LightingController/res/layout/popup.xml b/client/AndroidClients/LightingController/res/layout/popup.xml
index 0ac1cdb..0ac1cdb 100644..100755
--- a/client/AndroidClients/LightingController/res/layout/popup.xml
+++ b/client/AndroidClients/LightingController/res/layout/popup.xml
diff --git a/client/AndroidClients/LightingController/res/layout/sceneview.xml b/client/AndroidClients/LightingController/res/layout/sceneview.xml
index 55c3ac5..55c3ac5 100644..100755
--- a/client/AndroidClients/LightingController/res/layout/sceneview.xml
+++ b/client/AndroidClients/LightingController/res/layout/sceneview.xml
diff --git a/client/AndroidClients/LightingController/res/layout/zllmain.xml b/client/AndroidClients/LightingController/res/layout/zllmain.xml
index 819e783..819e783 100644..100755
--- a/client/AndroidClients/LightingController/res/layout/zllmain.xml
+++ b/client/AndroidClients/LightingController/res/layout/zllmain.xml
diff --git a/client/AndroidClients/LightingController/res/layout/zllmainportraite.xml b/client/AndroidClients/LightingController/res/layout/zllmainportraite.xml
index f2038fc..f2038fc 100644..100755
--- a/client/AndroidClients/LightingController/res/layout/zllmainportraite.xml
+++ b/client/AndroidClients/LightingController/res/layout/zllmainportraite.xml
diff --git a/client/AndroidClients/LightingController/res/values/strings.xml b/client/AndroidClients/LightingController/res/values/strings.xml
index 4a3186b..4a3186b 100644..100755
--- a/client/AndroidClients/LightingController/res/values/strings.xml
+++ b/client/AndroidClients/LightingController/res/values/strings.xml
diff --git a/client/AndroidClients/LightingController/res/values/styles.xml b/client/AndroidClients/LightingController/res/values/styles.xml
index 37cae65..37cae65 100644..100755
--- a/client/AndroidClients/LightingController/res/values/styles.xml
+++ b/client/AndroidClients/LightingController/res/values/styles.xml
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/ColourPicker.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/ColourPicker.java
index b6bbb30..b6bbb30 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/ColourPicker.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/ColourPicker.java
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/LightingController.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/LightingController.java
index 8c787fd..4ee66fd 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/LightingController.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/LightingController.java
@@ -145,7 +145,7 @@ public class LightingController extends Activity{
145 ZigbeeSrpcClient.discoverGroups(); 145 ZigbeeSrpcClient.discoverGroups();
146 ZigbeeSrpcClient.discoverScenes(); 146 ZigbeeSrpcClient.discoverScenes();
147 //wait for responses 147 //wait for responses
148 try { TimeUnit.MILLISECONDS.sleep(200); } catch (InterruptedException e) {e.printStackTrace();} 148 try { TimeUnit.MILLISECONDS.sleep(500); } catch (InterruptedException e) {e.printStackTrace();}
149 149
150 startActivity(new Intent(LightingController.this, zllMain.class)); 150 startActivity(new Intent(LightingController.this, zllMain.class));
151 } 151 }
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeAssistant.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeAssistant.java
index bfe52aa..29aed19 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeAssistant.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeAssistant.java
@@ -41,7 +41,7 @@
41package com.lightingcontroller.Zigbee; 41package com.lightingcontroller.Zigbee;
42 42
43import java.util.ArrayList; 43import java.util.ArrayList;
44import java.util.Calendar; 44import java.util.Arrays;
45import java.util.HashMap; 45import java.util.HashMap;
46import java.util.List; 46import java.util.List;
47 47
@@ -54,15 +54,11 @@ import android.widget.Toast;
54 54
55public class ZigbeeAssistant implements Runnable { 55public class ZigbeeAssistant implements Runnable {
56 56
57 //public static final boolean USE_JNI = true;
58 public static final boolean USE_JNI = false;
59
60 public static boolean gateWayConnected = false; 57 public static boolean gateWayConnected = false;
61 public static boolean initializing = true; 58 public static boolean initializing = true;
62 59
63 private static String TAG = "ZigbeeAssistant"; 60 private static String TAG = "ZigbeeAssistant";
64 public static ZigbeeSrpcClient zigbeeSrpcClient; 61 public static ZigbeeSrpcClient zigbeeSrpcClient;
65 public static String ZigbeeSrpcClientGatewayIp = "192.168.1.220";
66 62
67 static Thread thread; 63 static Thread thread;
68 static Activity mainAct; 64 static Activity mainAct;
@@ -73,15 +69,9 @@ public class ZigbeeAssistant implements Runnable {
73 69
74 private static int LightDeviceIdx = 0; 70 private static int LightDeviceIdx = 0;
75 71
76 static public int lastTempReading = 65535;
77 static public List<Integer> powerReadings = new ArrayList<Integer>();
78 static public List<Long> powerReadingsTimes = new ArrayList<Long>();
79 static public HashMap<Short,Long> nwrkToIEEE = new HashMap<Short,Long>(); 72 static public HashMap<Short,Long> nwrkToIEEE = new HashMap<Short,Long>();
80 73
81 public static native int runMain(); 74 public static native int runMain();
82 public static native boolean isRunning();
83 public static native short requestThermostatReading(short networkaddr, char end); // Get ThermostatReading
84 public static native short requestPowerReading(short networkaddr, char end); // Get ThermostatReading
85 public static native void setDeviceState(short networkaddr, char end, boolean state); // Set device state on/off 75 public static native void setDeviceState(short networkaddr, char end, boolean state); // Set device state on/off
86 public static native void setDeviceLevel(short networkaddr, char end, char level, short transitionTime); // Set device level/dim 76 public static native void setDeviceLevel(short networkaddr, char end, char level, short transitionTime); // Set device level/dim
87 public static native void setDeviceColour(short networkaddr, char end, char hue, char saturation, short transitionTime); // Set device Color 77 public static native void setDeviceColour(short networkaddr, char end, char hue, char saturation, short transitionTime); // Set device Color
@@ -90,19 +80,17 @@ public class ZigbeeAssistant implements Runnable {
90 short network_b, char end_b, int ieel_b, int ieeh_b, 80 short network_b, char end_b, int ieel_b, int ieeh_b,
91 short clusterId); // Bind Devices 81 short clusterId); // Bind Devices
92 82
83 static final byte EP_INFO_TYPE_EXISTING = 0;
84 static final byte EP_INFO_TYPE_NEW = 1;
85 static final byte EP_INFO_TYPE_UPDATED = 2;
86 static final byte EP_INFO_TYPE_REMOVED = 4;
93 87
88 static int cnt = 0;
94 89
95 static 90 public static void enableNotify(Activity activity, int timeOut)
96 { 91 {
97 if(USE_JNI) 92 ZigbeeNotification.init(activity);
98 System.loadLibrary("zigbee_assistant_jni"); //Loading native library 93 }
99
100 }
101
102 public static void notifyUser(String s)
103 {
104 ZigbeeNotification.showNotification(s);
105 }
106 94
107 public static List<ZigbeeDevice> getDevices() 95 public static List<ZigbeeDevice> getDevices()
108 { 96 {
@@ -111,9 +99,6 @@ public class ZigbeeAssistant implements Runnable {
111 99
112 public static void addGroup(ZigbeeDevice d, String groupName ) 100 public static void addGroup(ZigbeeDevice d, String groupName )
113 { 101 {
114 //ZigbeeGroup newGroup = new ZigbeeGroup(groupName);
115 //ourGroups.add(newGroup);
116
117 ZigbeeSrpcClient.addGroup((short) d.NetworkAddr,d.EndPoint, groupName); 102 ZigbeeSrpcClient.addGroup((short) d.NetworkAddr,d.EndPoint, groupName);
118 } 103 }
119 104
@@ -142,60 +127,48 @@ public class ZigbeeAssistant implements Runnable {
142 return ourScenes; 127 return ourScenes;
143 } 128 }
144 129
145 public static void deviceAnnounce(int nwrk, long ieee1) 130 public static void newDevice(int ProfileId, int DeviceId, int NetworkAddr, char EndPoint, byte ieee[], String deviceName, byte newDevFlag)
146 {
147 // TODO Auto-generated method stub
148
149 if (nwrkToIEEE.containsKey(nwrk))
150 nwrkToIEEE.remove(nwrk);
151 nwrkToIEEE.put((short)nwrk, ieee1);
152 }
153
154
155 public static void deviceAnnounce(int nwrk, int ieee1, int ieee2)
156 { 131 {
157 long t2; 132 //find old device
158 long t = (((long)ieee2))<<32; 133 ZigbeeDevice device = getDevice(ieee, EndPoint);
159 134
160 if(ieee1 < 0) 135 if(newDevFlag != EP_INFO_TYPE_REMOVED)
161 { 136 {
162 long t3 = 2147483647; 137 if(device != null)
163 t3 = t3 + 2147483647; 138 {
164 t3 = t3 + 2; 139 ZigbeeDevice newDevice = new ZigbeeDevice(ProfileId, DeviceId, NetworkAddr, EndPoint, ieee, deviceName, LightDeviceIdx++);
165 t2 = (((long)ieee1)); 140 device.updateDevice(newDevice);
166 t2 = t2+t3; 141 }
142 else
143 {
144 device = new ZigbeeDevice(ProfileId, DeviceId, NetworkAddr, EndPoint, ieee, deviceName, LightDeviceIdx++);
145 ourDevices.add(device);
146 }
167 } 147 }
168 else 148 else
169 { 149 {
170 t2 = ieee1; 150 if(device != null)
171 } 151 {
172 t = t | t2; 152 ourDevices.remove(device);
173 if (nwrkToIEEE.containsKey(nwrk)) 153 if(device.hasColourable || device.hasSwitchable || device.hasDimmable)
174 nwrkToIEEE.remove(nwrk); 154 {
175 nwrkToIEEE.put((short)nwrk, t); 155 ZigbeeNotification.showRemoveDeviceNotification(device.Name, 5000);
176 } 156 }
177 157 }
178 public static void newDevice(int ProfileId, int DeviceId, int NetworkAddr, char EndPoint, byte ieee[], String deviceName)
179 {
180 ZigbeeDevice oldD = ifDeviceExists(NetworkAddr,EndPoint);
181 if (oldD != null)
182 {
183 if (oldD.ProfileId == ProfileId)
184 return;
185 oldD = new ZigbeeDevice(ProfileId, DeviceId, NetworkAddr, EndPoint, ieee, deviceName, LightDeviceIdx++);
186 return;
187 } 158 }
188 ZigbeeDevice newDevice = new ZigbeeDevice(ProfileId, DeviceId, NetworkAddr, EndPoint, ieee, deviceName, LightDeviceIdx++); 159
189 ourDevices.add(newDevice); 160 if( (newDevFlag == EP_INFO_TYPE_NEW) && (device.hasColourable || device.hasSwitchable || device.hasDimmable))
161 {
162 ZigbeeNotification.showNewDeviceNotification(device);
163 }
190 } 164 }
191 165
192 public static void newGroup( String groupName ) 166 public static void newGroup( String groupName )
193 { 167 {
194 ZigbeeGroup newGroup = new ZigbeeGroup(groupName); 168 ZigbeeGroup newGroup = new ZigbeeGroup(groupName);
195 ourGroups.add(newGroup); 169 ourGroups.add(newGroup);
196 170
197 //Create new group on gateway (with invalid nwkAddr so not device is added to the group) 171 //Group will not be created on the GW until a device is added
198 ZigbeeSrpcClient.addGroup((short) 0xFFFF, (char) 0xFF, groupName);
199 } 172 }
200 173
201 public static void newGroup(String groupName, int groupId, int status) 174 public static void newGroup(String groupName, int groupId, int status)
@@ -253,9 +226,8 @@ public class ZigbeeAssistant implements Runnable {
253 if(ourScenes.contains(newScene) == false) 226 if(ourScenes.contains(newScene) == false)
254 { 227 {
255 ourScenes.add(newScene); 228 ourScenes.add(newScene);
256 } 229 }
257 230 //Scene will not be created on the GW until scene is stored
258 ZigbeeSrpcClient.storeScene( sceneName, groupId );
259 } 231 }
260 232
261 public static boolean bindDevicesOnOff(ZigbeeDevice a, ZigbeeDevice b) 233 public static boolean bindDevicesOnOff(ZigbeeDevice a, ZigbeeDevice b)
@@ -301,6 +273,11 @@ public class ZigbeeAssistant implements Runnable {
301 ZigbeeSrpcClient.changeDeviceName(d, newName); 273 ZigbeeSrpcClient.changeDeviceName(d, newName);
302 } 274 }
303 } 275 }
276
277 public static void openNetwork(byte duration)
278 {
279 ZigbeeSrpcClient.openNetwork(duration);
280 }
304 281
305 public static ZigbeeDevice ifDeviceExists(int NetworkAddr, char EndPoint) 282 public static ZigbeeDevice ifDeviceExists(int NetworkAddr, char EndPoint)
306 { 283 {
@@ -319,6 +296,23 @@ public class ZigbeeAssistant implements Runnable {
319 return ret; 296 return ret;
320 } 297 }
321 298
299 public static ZigbeeDevice getDevice(byte ieee[], char EndPoint)
300 {
301 int last = ourDevices.size()-1;
302 int i = last;
303 ZigbeeDevice ret = null;
304 for (i = last ; i >= 0 ; i--)
305 {
306 ret = ourDevices.get(i);
307 if( (Arrays.equals(ret.Ieee, ieee)) && (ret.EndPoint == EndPoint))
308 break;
309 }
310 if (i < 0)
311 return null;
312 else
313 return ret;
314 }
315
322 public static boolean hasAnySwitchers() 316 public static boolean hasAnySwitchers()
323 { 317 {
324 for (int i = 0 ; i < ourDevices.size() ; i++) 318 for (int i = 0 ; i < ourDevices.size() ; i++)
@@ -330,18 +324,6 @@ public class ZigbeeAssistant implements Runnable {
330 return false; 324 return false;
331 } 325 }
332 326
333 public static void newDeviceCluster(int NetworkAddr, char EndPoint, boolean in, int ClusterId)
334 {
335 ZigbeeDevice toAddto = ifDeviceExists(NetworkAddr, EndPoint);
336 if (toAddto == null)
337 {
338 Log.w(TAG, "Couldn't find Device");
339 return;
340 }
341
342 toAddto.addCluster(in, ClusterId);
343 }
344
345 public ZigbeeAssistant() 327 public ZigbeeAssistant()
346 { 328 {
347 ourDevices.clear(); 329 ourDevices.clear();
@@ -363,11 +345,7 @@ public class ZigbeeAssistant implements Runnable {
363 if (d.hasDimmable) 345 if (d.hasDimmable)
364 s+="\t: Dimmable\n"; 346 s+="\t: Dimmable\n";
365 if (d.hasColourable) 347 if (d.hasColourable)
366 s+="\t: Colourable\n"; 348 s+="\t: Colourable\n";
367 if (d.hasThermometer)
368 s+="\t: Measures Temperature\n";
369 if (d.hasPowerUsage)
370 s+="\t: Measures Power Usage\n";
371 if (d.hasOutSwitch) 349 if (d.hasOutSwitch)
372 s+="\t: Switches Others\n"; 350 s+="\t: Switches Others\n";
373 if (d.hasOutLeveL) 351 if (d.hasOutLeveL)
@@ -406,17 +384,20 @@ public class ZigbeeAssistant implements Runnable {
406 return s; 384 return s;
407 } 385 }
408 386
409 public static void haveTemperature(int NetworkAddr, char EndPoint, int data) 387 public static void IdentifyDevice(ZigbeeDevice d, short identifyTime)
388 {
389 ZigbeeSrpcClient.IdentifyDevice((short) d.NetworkAddr, ZigbeeSrpcClient.Addr16Bit, d.EndPoint, identifyTime);
390 }
391
392 public static void IdentifyGroup(ZigbeeGroup g, short identifyTime)
410 { 393 {
411 lastTempReading = data; 394 ZigbeeSrpcClient.IdentifyDevice((short) g.getGroupId(), ZigbeeSrpcClient.AddrGroup, (char)0xFF, identifyTime);
412 } 395 }
413 396
414 public static void setDeviceState(ZigbeeDevice d, boolean state) 397 public static void setDeviceState(ZigbeeDevice d, boolean state)
415 { 398 {
416 if(USE_JNI) 399
417 setDeviceState((short) d.NetworkAddr,d.EndPoint,state); 400 ZigbeeSrpcClient.setDeviceState((short) d.NetworkAddr, ZigbeeSrpcClient.Addr16Bit, d.EndPoint,state);
418 else
419 ZigbeeSrpcClient.setDeviceState((short) d.NetworkAddr, ZigbeeSrpcClient.Addr16Bit, d.EndPoint,state);
420 } 401 }
421 402
422 public static void setDeviceState(ZigbeeGroup g, boolean state) 403 public static void setDeviceState(ZigbeeGroup g, boolean state)
@@ -428,23 +409,17 @@ public class ZigbeeAssistant implements Runnable {
428 { 409 {
429 float[] hsv = new float[3]; 410 float[] hsv = new float[3];
430 Color.colorToHSV(colour, hsv); 411 Color.colorToHSV(colour, hsv);
431 if (USE_JNI) 412 ZigbeeSrpcClient.setDeviceColor((short) d.NetworkAddr, ZigbeeSrpcClient.Addr16Bit, d.EndPoint,(char)((hsv[0]/360)*0xFF), (char)(hsv[1]*0xFF),(short)10);
432 setDeviceColour((short) d.NetworkAddr,d.EndPoint,(char)((hsv[0]/360)*0xFF), (char)(hsv[1]*0xFF),(short)10);
433 else
434 ZigbeeSrpcClient.setDeviceColor((short) d.NetworkAddr, ZigbeeSrpcClient.Addr16Bit, d.EndPoint,(char)((hsv[0]/360)*0xFF), (char)(hsv[1]*0xFF),(short)10);
435 } 413 }
436 414
437 public static void setDeviceHueSat(ZigbeeDevice d, byte hue, byte sat) 415 public static void setDeviceHueSat(ZigbeeDevice d, byte hue, byte sat)
438 { 416 {
439 if (USE_JNI) 417 ZigbeeSrpcClient.setDeviceColor((short) d.NetworkAddr, ZigbeeSrpcClient.Addr16Bit, d.EndPoint, (char) hue, (char) sat,(short)10);
440 setDeviceColour((short) d.NetworkAddr,d.EndPoint,(char) hue, (char) sat,(short)10);
441 else
442 ZigbeeSrpcClient.setDeviceColor((short) d.NetworkAddr, ZigbeeSrpcClient.Addr16Bit, d.EndPoint, (char) hue, (char) sat,(short)10);
443 } 418 }
444 419
445 public static void setDeviceHueSat(ZigbeeGroup g, byte hue, byte sat) 420 public static void setDeviceHueSat(ZigbeeGroup g, byte hue, byte sat)
446 { 421 {
447 ZigbeeSrpcClient.setDeviceColor((short) g.getGroupId(), ZigbeeSrpcClient.AddrGroup, (char) 0xFF, (char) hue, (char) sat,(short)10); 422 ZigbeeSrpcClient.setDeviceColor((short) g.getGroupId(), ZigbeeSrpcClient.AddrGroup, (char) 0xFF, (char) hue, (char) sat,(short)10);
448 } 423 }
449 424
450 public static void setDeviceLevel(ZigbeeDevice d, int colour) 425 public static void setDeviceLevel(ZigbeeDevice d, int colour)
@@ -456,15 +431,12 @@ public class ZigbeeAssistant implements Runnable {
456 431
457 public static void setDeviceLevel(ZigbeeDevice d, char level) 432 public static void setDeviceLevel(ZigbeeDevice d, char level)
458 { 433 {
459 if(USE_JNI) 434 ZigbeeSrpcClient.setDeviceLevel((short) d.NetworkAddr, ZigbeeSrpcClient.Addr16Bit, d.EndPoint,level,(short)10);
460 setDeviceLevel((short) d.NetworkAddr,d.EndPoint,level,(short)10);
461 else
462 ZigbeeSrpcClient.setDeviceLevel((short) d.NetworkAddr, ZigbeeSrpcClient.Addr16Bit, d.EndPoint,level,(short)10);
463 } 435 }
464 436
465 public static void setDeviceLevel(ZigbeeGroup g, char level) 437 public static void setDeviceLevel(ZigbeeGroup g, char level)
466 { 438 {
467 ZigbeeSrpcClient.setDeviceLevel((short) g.getGroupId(), ZigbeeSrpcClient.AddrGroup, (char) 0xFF,level,(short)10); 439 ZigbeeSrpcClient.setDeviceLevel((short) g.getGroupId(), ZigbeeSrpcClient.AddrGroup, (char) 0xFF,level,(short)10);
468 } 440 }
469 441
470 public static void getDeviceState(ZigbeeDevice d) 442 public static void getDeviceState(ZigbeeDevice d)
@@ -488,20 +460,7 @@ public class ZigbeeAssistant implements Runnable {
488 } 460 }
489 461
490 public void run() { 462 public void run() {
491 if(USE_JNI) 463 Log.d(TAG, "Begin Zigbee");
492 { 464 zigbeeSrpcClient = new ZigbeeSrpcClient();
493 Log.d(TAG, "Begin Zigbee");
494 final int returnvalue = runMain();
495 mainAct.runOnUiThread(new Runnable() {
496 public void run() {
497 Toast.makeText(mainAct, "Zigbee has failed ("+returnvalue+") \n - Is the dongle connected and chmodded?", Toast.LENGTH_LONG).show();
498 }
499 });
500 }
501 else
502 {
503 Log.d(TAG, "Begin Zigbee");
504 zigbeeSrpcClient = new ZigbeeSrpcClient();
505 }
506 } 465 }
507} 466}
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeDevice.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeDevice.java
index 4ff3119..8076bca 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeDevice.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeDevice.java
@@ -62,8 +62,6 @@ public class ZigbeeDevice {
62 public boolean hasColourable = false; 62 public boolean hasColourable = false;
63 public boolean hasDimmable = false; 63 public boolean hasDimmable = false;
64 public boolean hasSwitchable = false; 64 public boolean hasSwitchable = false;
65 public boolean hasThermometer = false;
66 public boolean hasPowerUsage = false;
67 public boolean hasOutSwitch = false; 65 public boolean hasOutSwitch = false;
68 public boolean hasOutLeveL = false; 66 public boolean hasOutLeveL = false;
69 public boolean hasOutColor = false; 67 public boolean hasOutColor = false;
@@ -374,22 +372,37 @@ public class ZigbeeDevice {
374 default: Type = "Unknown Device"; Name="Unknown"; 372 default: Type = "Unknown Device"; Name="Unknown";
375 } 373 }
376 } 374 }
377 375
378 //String notification = "New "+Type+" connected!"; 376 if(!_deviceName.isEmpty())
379 //ZigbeeNotification.showNotification(notification); 377 {
378 Name = _deviceName;
379 }
380 } 380 }
381 381
382 public void updateDevice(ZigbeeDevice device)
383 {
384 Name = device.Name;
385 Type = device.Type;
386 ProfileId = device.ProfileId;
387 DeviceId = device.DeviceId;
388 NetworkAddr = device.NetworkAddr;
389 hasColourable = device.hasColourable;
390 hasDimmable = device.hasDimmable;
391 hasSwitchable = device.hasSwitchable;
392 hasOutLeveL = device.hasOutLeveL;
393 hasOutScene = device.hasOutScene;
394 hasOutGroup = device.hasOutGroup;
395 }
396
382 public void addCluster(boolean in, int ClusterId) 397 public void addCluster(boolean in, int ClusterId)
383 { 398 {
384 if (in) 399 if (in)
385 { 400 {
386 switch (ClusterId) 401 switch (ClusterId)
387 { 402 {
388 case (0x0402): hasThermometer = true; break;
389 case (0x0006): hasSwitchable = true; break; 403 case (0x0006): hasSwitchable = true; break;
390 case (0x0008): hasDimmable = true; break; 404 case (0x0008): hasDimmable = true; break;
391 case (0x0300): hasColourable = true; break; 405 case (0x0300): hasColourable = true; break;
392 case (0x0702): hasPowerUsage = true; break;
393 } 406 }
394 } else 407 } else
395 { 408 {
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeGroup.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeGroup.java
index cb87ac6..cb87ac6 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeGroup.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeGroup.java
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeNotification.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeNotification.java
index 88a7c33..57bf439 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeNotification.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeNotification.java
@@ -1,197 +1,278 @@
1/************************************************************************************************** 1/**************************************************************************************************
2 Filename: ZigBeeNotification.java 2 Filename: ZigBeeNotification.java
3 Revised: $$ 3 Revised: $$
4 Revision: $$ 4 Revision: $$
5 5
6 Description: ZigBee Notification Class 6 Description: ZigBee Notification Class
7 7
8 Copyright (C) {2012} Texas Instruments Incorporated - http://www.ti.com/ 8 Copyright (C) {2012} Texas Instruments Incorporated - http://www.ti.com/
9 9
10 10
11 Redistribution and use in source and binary forms, with or without 11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions 12 modification, are permitted provided that the following conditions
13 are met: 13 are met:
14 14
15 Redistributions of source code must retain the above copyright 15 Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer. 16 notice, this list of conditions and the following disclaimer.
17 17
18 Redistributions in binary form must reproduce the above copyright 18 Redistributions in binary form must reproduce the above copyright
19 notice, this list of conditions and the following disclaimer in the 19 notice, this list of conditions and the following disclaimer in the
20 documentation and/or other materials provided with the 20 documentation and/or other materials provided with the
21 distribution. 21 distribution.
22 22
23 Neither the name of Texas Instruments Incorporated nor the names of 23 Neither the name of Texas Instruments Incorporated nor the names of
24 its contributors may be used to endorse or promote products derived 24 its contributors may be used to endorse or promote products derived
25 from this software without specific prior written permission. 25 from this software without specific prior written permission.
26 26
27 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 38
39**************************************************************************************************/ 39 **************************************************************************************************/
40 40
41package com.lightingcontroller.Zigbee; 41package com.lightingcontroller.Zigbee;
42 42
43import java.util.ArrayList; 43import java.util.ArrayList;
44 44import java.util.List;
45import com.lightingcontroller.R; 45
46 46import com.lightingcontroller.R;
47import android.app.Activity; 47import com.lightingcontroller.zllMain;
48import android.app.AlertDialog; 48
49import android.content.DialogInterface; 49import android.app.Activity;
50import android.graphics.Color; 50import android.app.AlertDialog;
51import android.graphics.drawable.BitmapDrawable; 51import android.app.AlertDialog.Builder;
52import android.os.Handler; 52import android.app.Dialog;
53import android.util.AttributeSet; 53import android.content.DialogInterface;
54import android.view.Gravity; 54import android.content.Intent;
55import android.view.LayoutInflater; 55import android.graphics.Color;
56import android.view.MotionEvent; 56import android.graphics.drawable.BitmapDrawable;
57import android.view.View; 57import android.os.Handler;
58import android.view.View.OnClickListener; 58import android.view.Gravity;
59import android.view.View.OnTouchListener; 59import android.view.LayoutInflater;
60import android.view.ViewGroup; 60import android.view.MotionEvent;
61import android.widget.ImageView; 61import android.view.View;
62import android.widget.LinearLayout; 62import android.view.View.OnTouchListener;
63import android.widget.PopupWindow; 63import android.view.ViewGroup;
64import android.widget.TextView; 64import android.widget.EditText;
65import android.widget.Toast; 65import android.widget.LinearLayout;
66 66import android.widget.PopupWindow;
67public class ZigbeeNotification { 67import android.widget.TextView;
68 68
69 static Activity acty; 69public class ZigbeeNotification {
70 static Handler handle = new Handler(); 70
71 static boolean alive; 71 private static Activity acty = null;
72 static PopupWindow popwindow = null; 72 private static Dialog notificationDialog = null;
73 73 private static boolean deviceRemove = false;
74 static ArrayList<String> notices = new ArrayList<String>(); 74
75 75 static ArrayList<ZigbeeDevice> newDevNotifications = new ArrayList<ZigbeeDevice>();
76 static int timeout = 5000; 76
77 77 static int timeout = 5000;
78 public static void init(Activity a, int time_out) 78 static int cnt = 0;
79 { 79
80 init(a); 80 public static void init(Activity a) {
81 timeout = time_out; 81 acty = a;
82 } 82 }
83 83
84 public static void init(Activity a) 84 public static void closing() {
85 { 85 closeDialog();
86 acty = a; 86 acty = null;
87 if (notices.size() > 0) 87 }
88 { 88
89 for (int i = 0 ; i < notices.size() ; i++) 89 public static void showNewDeviceNotification(final ZigbeeDevice device) {
90 { 90 cnt++;
91 showNotificationOnScreen(notices.get(i)); 91 if(cnt > 1)
92 } 92 cnt = 0;
93 for (int i = 0 ; i < notices.size() ; i++) 93
94 { 94 if (acty != null) {
95 notices.remove(i); 95 if(notificationDialog != null)
96 } 96 {
97 } 97 newDevNotifications.add(device);
98 } 98 }
99 99 else
100 public static void closing() 100 {
101 { 101 showNewDeviceNotificationDialog(device);
102 if (popwindow != null) 102 }
103 { 103 }
104 popwindow.dismiss(); 104 else
105 handle.removeCallbacks(closePopupTask); 105 {
106 } 106
107 popwindow = null; 107 }
108 acty = null; 108
109 } 109 while (!newDevNotifications.isEmpty()) {
110 110 if (acty != null) {
111 public static void showNotification(String text) 111 if(notificationDialog == null)
112 { 112 {
113 if (acty == null) 113 ZigbeeDevice notifyDevice = newDevNotifications.remove(0);
114 { 114 showNewDeviceNotificationDialog(notifyDevice);
115 notices.add(text); 115 }
116 } 116 }
117 else 117 }
118 { 118
119 showNotificationOnScreen(text); 119/*
120 } 120 // restart activity to update device drop down
121 } 121 Intent intent = new Intent();
122 122 intent.setClass(acty, acty.getClass());
123 public static void showNotificationOnScreen(final String text) 123 acty.finish();
124 { 124 acty.startActivity(intent);
125 final TextView text1 = new TextView(acty); 125*/
126 text1.setText(text); 126 }
127 text1.setTextColor(Color.WHITE); 127
128 text1.setTextSize(18); 128 public static void showNewDeviceNotificationDialog(
129 text1.setGravity(Gravity.CENTER); 129 final ZigbeeDevice device) {
130 130 // close any existing notification
131 if (popwindow == null) 131 closeDialog();
132 { 132
133 LayoutInflater inflater = (LayoutInflater) acty.getLayoutInflater(); 133 //put device into identify
134 View layout = inflater.inflate(R.layout.popup, 134 ZigbeeAssistant.setDeviceState(device,true);
135 (ViewGroup) acty.findViewById(R.id.toast_layout_root)); 135 ZigbeeAssistant.setDeviceLevel(device,0xFF);
136 136 ZigbeeAssistant.IdentifyDevice(device,(short) 600);
137 ((LinearLayout) layout.findViewById(R.id.popup_text_box)).addView(text1); 137
138 138 String Title = "New Device Found";
139 popwindow = new PopupWindow(layout,400,100,false); 139 String Msg = "Please Enter the name of the device";
140 popwindow.setAnimationStyle(R.style.Animation_Popup); 140 final EditText t = new EditText(acty);
141 popwindow.setBackgroundDrawable(new BitmapDrawable()); 141 t.setText(device.Name);
142 popwindow.setOutsideTouchable(false); 142
143 popwindow.setTouchable(true); 143 final AlertDialog.Builder builder = new AlertDialog.Builder(acty);
144 popwindow.setTouchInterceptor(new OnTouchListener() { 144 builder.setTitle(Title)
145 public boolean onTouch(View v, MotionEvent event) { 145 .setMessage(Msg)
146 handle.removeCallbacks(closePopupTask); 146 .setView(t)
147 handle.post(closePopupTask); 147 .setPositiveButton("OK",
148 return false; 148 new DialogInterface.OnClickListener()
149 } 149 {
150 }); 150 public void onClick(DialogInterface dialoginterface,int i){
151 try{ 151 ZigbeeAssistant.setDeviceName(device.Name, t.getText().toString());
152 acty.runOnUiThread (new Runnable(){ 152 zllMain.setCurrentDevice(device);
153 public void run() { 153 closeDialog();
154// if (acty!=null && acty.findViewById(R.id.MainMenu_lay)!=null) 154 //stop device identifying
155// popwindow.showAtLocation(acty.findViewById(R.id.MainMenu_lay), Gravity.CENTER_HORIZONTAL|Gravity.BOTTOM, 0, 0); 155 ZigbeeAssistant.IdentifyDevice(device,(short) 0);
156// else 156 }
157// notices.add(text); 157 });
158 } 158
159 }); 159
160 } catch (Exception e) 160 try {
161 { 161 acty.runOnUiThread(new Runnable() {
162 // Dagnabbit. 162 public void run() {
163 popwindow = null; 163 if (acty != null) {
164 } 164 // if(acty.hasWindowFocus())
165 } 165 // {
166 else 166 notificationDialog = builder.create();
167 { 167 notificationDialog.show();
168 168 // }
169 acty.runOnUiThread (new Runnable(){ 169 }
170 public void run() { 170 }
171 LinearLayout l = (LinearLayout)popwindow.getContentView().findViewById(R.id.popup_text_box); 171 });
172 if (l.getChildCount()>2) 172 } catch (Exception e) {
173 l.removeViewAt(0); 173
174 l.addView(text1); 174 }
175 popwindow.update(); 175 }
176 } 176
177 }); 177 public static void showRemoveDeviceNotification(String deviceStr,
178 } 178 final int timeout) {
179 179 if (acty != null) {
180 handle.removeCallbacks(closePopupTask); 180 // close any existing notification
181 handle.postDelayed(closePopupTask, timeout); 181 closeDialog();
182 //SoundManager.playSound(SoundManager.NOTIFY, 1); 182
183 } 183 final AlertDialog.Builder builder = new AlertDialog.Builder(acty);
184 184 builder.setTitle("ZigBee Notification")
185 185 .setCancelable(false)
186 private static Runnable closePopupTask = new Runnable() { 186 .setMessage("Device Removed: " + deviceStr)
187 public void run() { 187 .setPositiveButton("Ok",
188 if (popwindow!=null) 188 new DialogInterface.OnClickListener() {
189 { 189 public void onClick(DialogInterface dialog,
190 popwindow.dismiss(); 190 int id) {
191 popwindow = null; 191 // restart activity to update device drop
192 } 192 // down
193 } 193 Intent intent = new Intent();
194 }; 194 intent.setClass(acty, acty.getClass());
195 195 acty.finish();
196 196 acty.startActivity(intent);
197} 197 closeDialog();
198 }
199 });
200
201 try {
202 acty.runOnUiThread(new Runnable() {
203 public void run() {
204 if (acty != null) {
205 // if(acty.hasWindowFocus())
206 // {
207 notificationDialog = builder.create();
208 notificationDialog.show();
209 // }
210 }
211 }
212 });
213 } catch (Exception e) {
214
215 }
216
217 new Thread(new Runnable() {
218 public void run() {
219 try {
220 Thread.sleep(timeout);
221 } catch (InterruptedException e) {
222 // TODO Auto-generated catch block
223 e.printStackTrace();
224 }
225 closeDialog();
226 }
227 }).start();
228
229 }
230 }
231
232 public static void showGeneralNotification(String notification,
233 final int timeout) {
234 if (acty != null) {
235 // close any existing notification
236 closeDialog();
237
238 final AlertDialog.Builder builder = new AlertDialog.Builder(acty);
239 builder.setTitle("ZigBee Notification").setCancelable(false)
240 .setMessage(notification);
241
242 try {
243 acty.runOnUiThread(new Runnable() {
244 public void run() {
245 if (acty != null) {
246 // if(acty.hasWindowFocus())
247 // {
248 notificationDialog = builder.create();
249 notificationDialog.show();
250 // }
251 }
252 }
253 });
254 } catch (Exception e) {
255
256 }
257
258 new Thread(new Runnable() {
259 public void run() {
260 try {
261 Thread.sleep(timeout);
262 } catch (InterruptedException e) {
263 // TODO Auto-generated catch block
264 e.printStackTrace();
265 }
266 closeDialog();
267 }
268 }).start();
269 }
270 }
271
272 private static void closeDialog() {
273 if (notificationDialog != null) {
274 notificationDialog.cancel();
275 }
276 notificationDialog = null;
277 }
278}
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeScene.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeScene.java
index 80016c6..80016c6 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeScene.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeScene.java
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.java
index 812aafb..cb70a9f 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/Zigbee/ZigbeeSrpcClient.java
@@ -91,45 +91,49 @@ public class ZigbeeSrpcClient {
91 91
92 //SRPC CMD ID's 92 //SRPC CMD ID's
93 //define the outgoing RPSC command ID's 93 //define the outgoing RPSC command ID's
94 private static final byte RPCS_NEW_ZLL_DEVICE = (byte) 0x0001; 94 private static final byte SRPC_NEW_DEVICE = (byte) 0x0001;
95 private static final byte RPCS_DEV_ANNCE = (byte) 0x0002; 95 private static final byte SRPC_RESERVED_1 = (byte) 0x0002;
96 private static final byte RPCS_SIMPLE_DESC = (byte) 0x0003; 96 private static final byte SRPC_RESERVED_2 = (byte) 0x0003;
97 private static final byte RPCS_TEMP_READING = (byte) 0x0004; 97 private static final byte SRPC_RESERVED_3 = (byte) 0x0004;
98 private static final byte RPCS_POWER_READING = (byte) 0x0005; 98 private static final byte SRPC_RESERVED_4 = (byte) 0x0005;
99 private static final byte RPCS_PING = (byte) 0x0006; 99 private static final byte SRPC_RESERVED_5 = (byte) 0x0006;
100 private static final byte RPCS_GET_DEV_STATE_RSP = (byte) 0x0007; 100 private static final byte SRPC_GET_DEV_STATE_RSP = (byte) 0x0007;
101 private static final byte RPCS_GET_DEV_LEVEL_RSP = (byte) 0x0008; 101 private static final byte SRPC_GET_DEV_LEVEL_RSP = (byte) 0x0008;
102 private static final byte RPCS_GET_DEV_HUE_RSP = (byte) 0x0009; 102 private static final byte SRPC_GET_DEV_HUE_RSP = (byte) 0x0009;
103 private static final byte RPCS_GET_DEV_SAT_RSP = (byte) 0x000a; 103 private static final byte SRPC_GET_DEV_SAT_RSP = (byte) 0x000a;
104 private static final byte RPCS_ADD_GROUP_RSP = (byte) 0x000b; 104 private static final byte SRPC_ADD_GROUP_RSP = (byte) 0x000b;
105 private static final byte RPCS_GET_GROUP_RSP = (byte) 0x000c; 105 private static final byte SRPC_GET_GROUP_RSP = (byte) 0x000c;
106 private static final byte RPCS_ADD_SCENE_RSP = (byte) 0x000d; 106 private static final byte SRPC_ADD_SCENE_RSP = (byte) 0x000d;
107 private static final byte RPCS_GET_SCENE_RSP = (byte) 0x000e; 107 private static final byte SRPC_GET_SCENE_RSP = (byte) 0x000e;
108 108
109 109
110 //define incoming RPCS command ID's 110 //define incoming SRPC command ID's
111 private static final byte RPCS_CLOSE = (byte) 0x80; 111 private static final byte SRPC_CLOSE = (byte) 0x80;
112 private static final byte RPCS_GET_DEVICES = (byte) 0x81; 112 private static final byte SRPC_GET_DEVICES = (byte) 0x81;
113 private static final byte RPCS_SET_DEV_STATE = (byte) 0x82; 113 private static final byte SRPC_SET_DEV_STATE = (byte) 0x82;
114 private static final byte RPCS_SET_DEV_LEVEL = (byte) 0x83; 114 private static final byte SRPC_SET_DEV_LEVEL = (byte) 0x83;
115 private static final byte RPCS_SET_DEV_COLOR = (byte) 0x84; 115 private static final byte SRPC_SET_DEV_COLOR = (byte) 0x84;
116 private static final byte RPCS_GET_DEV_STATE = (byte) 0x85; 116 private static final byte SRPC_GET_DEV_STATE = (byte) 0x85;
117 private static final byte RPCS_GET_DEV_LEVEL = (byte) 0x86; 117 private static final byte SRPC_GET_DEV_LEVEL = (byte) 0x86;
118 private static final byte RPCS_GET_DEV_HUE = (byte) 0x87; 118 private static final byte SRPC_GET_DEV_HUE = (byte) 0x87;
119 private static final byte RPCS_GET_DEV_SAT = (byte) 0x88; 119 private static final byte SRPC_GET_DEV_SAT = (byte) 0x88;
120 private static final byte RPCS_BIND_DEVICES = (byte) 0x89; 120 private static final byte SRPC_BIND_DEVICES = (byte) 0x89;
121 private static final byte RPCS_GET_THERM_READING = (byte) 0x8a; 121 private static final byte SRPC_RESERVED_6 = (byte) 0x8a;
122 private static final byte RPCS_GET_POWER_READING = (byte) 0x8b; 122 private static final byte SRPC_RESERVED_7 = (byte) 0x8b;
123 private static final byte RPCS_DISCOVER_DEVICES = (byte) 0x8c; 123 private static final byte SRPC_RESERVED_8 = (byte) 0x8c;
124 private static final byte RPCS_SEND_ZCL = (byte) 0x8d; 124 private static final byte SRPC_RESERVED_9 = (byte) 0x8d;
125 private static final byte RPCS_GET_GROUPS = (byte) 0x8e; 125 private static final byte SRPC_GET_GROUPS = (byte) 0x8e;
126 private static final byte RPCS_ADD_GROUP = (byte) 0x8f; 126 private static final byte SRPC_ADD_GROUP = (byte) 0x8f;
127 private static final byte RPCS_GET_SCENES = (byte) 0x90; 127 private static final byte SRPC_GET_SCENES = (byte) 0x90;
128 private static final byte RPCS_STORE_SCENE = (byte) 0x91; 128 private static final byte SRPC_STORE_SCENE = (byte) 0x91;
129 private static final byte RPCS_RECALL_SCENE = (byte) 0x92; 129 private static final byte SRPC_RECALL_SCENE = (byte) 0x92;
130 private static final byte RPCS_IDENTIFY_DEVICE = (byte) 0x93; 130 private static final byte SRPC_IDENTIFY_DEVICE = (byte) 0x93;
131 private static final byte RPCS_CHANGE_DEVICE_NAME = (byte) 0x94; 131 private static final byte SRPC_CHANGE_DEVICE_NAME = (byte) 0x94;
132 132 private static final byte SRPC_REMOVE_DEVICE = (byte) 0x95;
133 private static final byte SRPC_OPEN_NETWORK = (byte) 0x9c;
134
135 private static final short JOIN_AUTH_NUM = (short) 0xebd4;
136
133 //SRPC AfAddr Addr modes ID's 137 //SRPC AfAddr Addr modes ID's
134 public static final byte AddrNotPresent = 0; 138 public static final byte AddrNotPresent = 0;
135 public static final byte AddrGroup = 1; 139 public static final byte AddrGroup = 1;
@@ -150,12 +154,13 @@ public class ZigbeeSrpcClient {
150 switch (msg[msgPtr + SRPC_CMD_ID_POS]) 154 switch (msg[msgPtr + SRPC_CMD_ID_POS])
151 { 155 {
152 156
153 case RPCS_NEW_ZLL_DEVICE: 157 case SRPC_NEW_DEVICE:
154 { 158 {
155 int profileId=0, deviceId=0, nwkAddr=0; 159 int profileId=0, deviceId=0, nwkAddr=0;
156 char endPoint; 160 char endPoint;
157 String deviceName = ""; 161 String deviceName = "";
158 byte[] ieee = new byte[8]; 162 byte[] ieee = new byte[8];
163 byte newDevFlag;
159 164
160 msgLen = msg[msgPtr + SRPC_CMD_LEN_POS] + 2; 165 msgLen = msg[msgPtr + SRPC_CMD_LEN_POS] + 2;
161 //index passed len and cmd ID 166 //index passed len and cmd ID
@@ -190,14 +195,12 @@ public class ZigbeeSrpcClient {
190 195
191 //index passed version 196 //index passed version
192 msgPtr++; 197 msgPtr++;
193 198
194 //index passed device name
195 int nameSize = msg[msgPtr++]; 199 int nameSize = msg[msgPtr++];
196 for(int i = 0; i < nameSize; i++) 200 for(int i = 0; i < nameSize; i++)
197 { 201 {
198 deviceName += (char) msg[msgPtr++]; 202 deviceName += (char) msg[msgPtr++];
199 } 203 }
200 msgPtr += nameSize;
201 204
202 //index passed status 205 //index passed status
203 msgPtr++; 206 msgPtr++;
@@ -208,11 +211,13 @@ public class ZigbeeSrpcClient {
208 ieee[i] = msg[msgPtr++]; 211 ieee[i] = msg[msgPtr++];
209 } 212 }
210 213
211 ZigbeeAssistant.newDevice(profileId, deviceId, nwkAddr, endPoint, ieee, deviceName); 214 newDevFlag = (byte) msg[msgPtr++];
212 215
216 ZigbeeAssistant.newDevice(profileId, deviceId, nwkAddr, endPoint, ieee, deviceName, newDevFlag);
217
213 break; 218 break;
214 } 219 }
215 case RPCS_ADD_GROUP_RSP: 220 case SRPC_ADD_GROUP_RSP:
216 { 221 {
217 short groupId = 0; 222 short groupId = 0;
218 msgLen = msg[msgPtr + SRPC_CMD_LEN_POS] + 2; 223 msgLen = msg[msgPtr + SRPC_CMD_LEN_POS] + 2;
@@ -244,9 +249,10 @@ public class ZigbeeSrpcClient {
244 break; 249 break;
245 } 250 }
246 251
247 case RPCS_GET_GROUP_RSP: 252 case SRPC_GET_GROUP_RSP:
248 { 253 {
249 short groupId = 0; 254 short groupId = 0;
255 String groupName = "";
250 msgLen = msg[msgPtr + SRPC_CMD_LEN_POS] + 2; 256 msgLen = msg[msgPtr + SRPC_CMD_LEN_POS] + 2;
251 257
252 //index passed len and cmd ID 258 //index passed len and cmd ID
@@ -259,15 +265,19 @@ public class ZigbeeSrpcClient {
259 int groupIdTemp = (msg[msgPtr] & 0xff); 265 int groupIdTemp = (msg[msgPtr] & 0xff);
260 groupId += (groupIdTemp << (8 * i)); 266 groupId += (groupIdTemp << (8 * i));
261 } 267 }
268
269 int nameSize = msg[msgPtr++];
270 for(int i = 0; i < nameSize; i++)
271 {
272 groupName += (char) msg[msgPtr++];
273 }
262 274
263 String groupNameStr = new String(msg, msgPtr+1, msg[msgPtr], Charset.defaultCharset()); 275 ZigbeeAssistant.newGroup(groupName, groupId, ZigbeeGroup.groupStatusActive);
264
265 ZigbeeAssistant.newGroup(groupNameStr, groupId, ZigbeeGroup.groupStatusActive);
266 276
267 break; 277 break;
268 } 278 }
269 279
270 case RPCS_ADD_SCENE_RSP: 280 case SRPC_ADD_SCENE_RSP:
271 { 281 {
272 short groupId = 0; 282 short groupId = 0;
273 byte sceneId = 0; 283 byte sceneId = 0;
@@ -303,10 +313,11 @@ public class ZigbeeSrpcClient {
303 break; 313 break;
304 } 314 }
305 315
306 case RPCS_GET_SCENE_RSP: 316 case SRPC_GET_SCENE_RSP:
307 { 317 {
308 short groupId = 0; 318 short groupId = 0;
309 byte sceneId = 0; 319 byte sceneId = 0;
320 String sceneName = "";
310 msgLen = msg[msgPtr + SRPC_CMD_LEN_POS] + 2; 321 msgLen = msg[msgPtr + SRPC_CMD_LEN_POS] + 2;
311 322
312 //index passed len and cmd ID 323 //index passed len and cmd ID
@@ -322,14 +333,18 @@ public class ZigbeeSrpcClient {
322 333
323 //Get the sceneId 334 //Get the sceneId
324 sceneId = (byte) msg[msgPtr++]; 335 sceneId = (byte) msg[msgPtr++];
336
337 int nameSize = msg[msgPtr++];
338 for(int i = 0; i < nameSize; i++)
339 {
340 sceneName += (char) msg[msgPtr++];
341 }
325 342
326 String sceneNameStr = new String(msg, msgPtr+1, msg[msgPtr], Charset.defaultCharset()); 343 ZigbeeAssistant.newScene(sceneName, groupId, sceneId, ZigbeeScene.sceneStatusActive);
327
328 ZigbeeAssistant.newScene(sceneNameStr, groupId, sceneId, ZigbeeScene.sceneStatusActive);
329 344
330 break; 345 break;
331 } 346 }
332 case RPCS_GET_DEV_STATE_RSP: 347 case SRPC_GET_DEV_STATE_RSP:
333 { 348 {
334 short nwkAddr = 0; 349 short nwkAddr = 0;
335 byte endPoint = 0; 350 byte endPoint = 0;
@@ -366,7 +381,7 @@ public class ZigbeeSrpcClient {
366 } 381 }
367 break; 382 break;
368 } 383 }
369 case RPCS_GET_DEV_LEVEL_RSP: 384 case SRPC_GET_DEV_LEVEL_RSP:
370 { 385 {
371 short nwkAddr = 0; 386 short nwkAddr = 0;
372 byte endPoint = 0; 387 byte endPoint = 0;
@@ -403,7 +418,7 @@ public class ZigbeeSrpcClient {
403 } 418 }
404 break; 419 break;
405 } 420 }
406 case RPCS_GET_DEV_HUE_RSP: 421 case SRPC_GET_DEV_HUE_RSP:
407 { 422 {
408 short nwkAddr = 0; 423 short nwkAddr = 0;
409 byte endPoint = 0; 424 byte endPoint = 0;
@@ -440,7 +455,7 @@ public class ZigbeeSrpcClient {
440 } 455 }
441 break; 456 break;
442 } 457 }
443 case RPCS_GET_DEV_SAT_RSP: 458 case SRPC_GET_DEV_SAT_RSP:
444 { 459 {
445 short nwkAddr = 0; 460 short nwkAddr = 0;
446 byte endPoint = 0; 461 byte endPoint = 0;
@@ -493,7 +508,7 @@ public class ZigbeeSrpcClient {
493 byte msgIdx; 508 byte msgIdx;
494 509
495 //set SRPC len and CMD ID 510 //set SRPC len and CMD ID
496 msg[SRPC_CMD_ID_POS] = RPCS_SET_DEV_STATE; 511 msg[SRPC_CMD_ID_POS] = SRPC_SET_DEV_STATE;
497 msg[SRPC_CMD_LEN_POS] = 13; 512 msg[SRPC_CMD_LEN_POS] = 13;
498 513
499 //set ptr to point to data 514 //set ptr to point to data
@@ -531,7 +546,7 @@ public class ZigbeeSrpcClient {
531 byte msgIdx; 546 byte msgIdx;
532 547
533 //set SRPC len and CMD ID 548 //set SRPC len and CMD ID
534 msg[SRPC_CMD_ID_POS] = RPCS_SET_DEV_LEVEL; 549 msg[SRPC_CMD_ID_POS] = SRPC_SET_DEV_LEVEL;
535 msg[SRPC_CMD_LEN_POS] = 15; 550 msg[SRPC_CMD_LEN_POS] = 15;
536 551
537 //set ptr to point to data 552 //set ptr to point to data
@@ -564,7 +579,7 @@ public class ZigbeeSrpcClient {
564 byte msgIdx; 579 byte msgIdx;
565 580
566 //set SRPC len and CMD ID 581 //set SRPC len and CMD ID
567 msg[SRPC_CMD_ID_POS] = RPCS_SET_DEV_COLOR; 582 msg[SRPC_CMD_ID_POS] = SRPC_SET_DEV_COLOR;
568 msg[SRPC_CMD_LEN_POS] = 16; 583 msg[SRPC_CMD_LEN_POS] = 16;
569 584
570 //set ptr to point to data 585 //set ptr to point to data
@@ -600,7 +615,7 @@ public class ZigbeeSrpcClient {
600 byte msgIdx; 615 byte msgIdx;
601 616
602 //set SRPC len and CMD ID 617 //set SRPC len and CMD ID
603 msg[SRPC_CMD_ID_POS] = RPCS_GET_DEV_STATE; 618 msg[SRPC_CMD_ID_POS] = SRPC_GET_DEV_STATE;
604 msg[SRPC_CMD_LEN_POS] = 13; 619 msg[SRPC_CMD_LEN_POS] = 13;
605 620
606 //set ptr to point to data 621 //set ptr to point to data
@@ -627,7 +642,7 @@ public class ZigbeeSrpcClient {
627 byte msgIdx; 642 byte msgIdx;
628 643
629 //set SRPC len and CMD ID 644 //set SRPC len and CMD ID
630 msg[SRPC_CMD_ID_POS] = RPCS_GET_DEV_LEVEL; 645 msg[SRPC_CMD_ID_POS] = SRPC_GET_DEV_LEVEL;
631 msg[SRPC_CMD_LEN_POS] = 13; 646 msg[SRPC_CMD_LEN_POS] = 13;
632 647
633 //set ptr to point to data 648 //set ptr to point to data
@@ -654,7 +669,7 @@ public class ZigbeeSrpcClient {
654 byte msgIdx; 669 byte msgIdx;
655 670
656 //set SRPC len and CMD ID 671 //set SRPC len and CMD ID
657 msg[SRPC_CMD_ID_POS] = RPCS_GET_DEV_HUE; 672 msg[SRPC_CMD_ID_POS] = SRPC_GET_DEV_HUE;
658 msg[SRPC_CMD_LEN_POS] = 13; 673 msg[SRPC_CMD_LEN_POS] = 13;
659 674
660 //set ptr to point to data 675 //set ptr to point to data
@@ -681,7 +696,7 @@ public class ZigbeeSrpcClient {
681 byte msgIdx; 696 byte msgIdx;
682 697
683 //set SRPC len and CMD ID 698 //set SRPC len and CMD ID
684 msg[SRPC_CMD_ID_POS] = RPCS_GET_DEV_SAT; 699 msg[SRPC_CMD_ID_POS] = SRPC_GET_DEV_SAT;
685 msg[SRPC_CMD_LEN_POS] = 13; 700 msg[SRPC_CMD_LEN_POS] = 13;
686 701
687 //set ptr to point to data 702 //set ptr to point to data
@@ -708,7 +723,7 @@ public class ZigbeeSrpcClient {
708 byte msgIdx; 723 byte msgIdx;
709 724
710 //set SRPC len and CMD ID 725 //set SRPC len and CMD ID
711 msg[SRPC_CMD_ID_POS] = RPCS_BIND_DEVICES; 726 msg[SRPC_CMD_ID_POS] = SRPC_BIND_DEVICES;
712 msg[SRPC_CMD_LEN_POS] = 22; 727 msg[SRPC_CMD_LEN_POS] = 22;
713 728
714 //set ptr to point to data 729 //set ptr to point to data
@@ -758,7 +773,7 @@ public class ZigbeeSrpcClient {
758 byte[] msg = new byte[2]; 773 byte[] msg = new byte[2];
759 774
760 //set SRPC len and CMD ID 775 //set SRPC len and CMD ID
761 msg[SRPC_CMD_ID_POS] = RPCS_GET_DEVICES; 776 msg[SRPC_CMD_ID_POS] = SRPC_GET_DEVICES;
762 msg[SRPC_CMD_LEN_POS] = 0; 777 msg[SRPC_CMD_LEN_POS] = 0;
763 778
764 sendSrpc(msg); 779 sendSrpc(msg);
@@ -769,7 +784,7 @@ public class ZigbeeSrpcClient {
769 byte[] msg = new byte[2]; 784 byte[] msg = new byte[2];
770 785
771 //set SRPC len and CMD ID 786 //set SRPC len and CMD ID
772 msg[SRPC_CMD_ID_POS] = RPCS_GET_GROUPS; 787 msg[SRPC_CMD_ID_POS] = SRPC_GET_GROUPS;
773 msg[SRPC_CMD_LEN_POS] = 0; 788 msg[SRPC_CMD_LEN_POS] = 0;
774 789
775 sendSrpc(msg); 790 sendSrpc(msg);
@@ -780,7 +795,7 @@ public class ZigbeeSrpcClient {
780 byte[] msg = new byte[2]; 795 byte[] msg = new byte[2];
781 796
782 //set SRPC len and CMD ID 797 //set SRPC len and CMD ID
783 msg[SRPC_CMD_ID_POS] = RPCS_GET_SCENES; 798 msg[SRPC_CMD_ID_POS] = SRPC_GET_SCENES;
784 msg[SRPC_CMD_LEN_POS] = 0; 799 msg[SRPC_CMD_LEN_POS] = 0;
785 800
786 sendSrpc(msg); 801 sendSrpc(msg);
@@ -792,7 +807,7 @@ public class ZigbeeSrpcClient {
792 byte msgIdx; 807 byte msgIdx;
793 808
794 //set SRPC len and CMD ID 809 //set SRPC len and CMD ID
795 msg[SRPC_CMD_ID_POS] = RPCS_ADD_GROUP; 810 msg[SRPC_CMD_ID_POS] = SRPC_ADD_GROUP;
796 msg[SRPC_CMD_LEN_POS] = (byte) (12 + groupName.length() + 1); 811 msg[SRPC_CMD_LEN_POS] = (byte) (12 + groupName.length() + 1);
797 812
798 //set ptr to point to data 813 //set ptr to point to data
@@ -825,7 +840,7 @@ public class ZigbeeSrpcClient {
825 byte msgIdx; 840 byte msgIdx;
826 841
827 //set SRPC len and CMD ID 842 //set SRPC len and CMD ID
828 msg[SRPC_CMD_ID_POS] = RPCS_STORE_SCENE; 843 msg[SRPC_CMD_ID_POS] = SRPC_STORE_SCENE;
829 msg[SRPC_CMD_LEN_POS] = (byte) (15 + sceneName.length()); 844 msg[SRPC_CMD_LEN_POS] = (byte) (15 + sceneName.length());
830 845
831 //set ptr to point to data 846 //set ptr to point to data
@@ -861,7 +876,7 @@ public class ZigbeeSrpcClient {
861 byte msgIdx; 876 byte msgIdx;
862 877
863 //set SRPC len and CMD ID 878 //set SRPC len and CMD ID
864 msg[SRPC_CMD_ID_POS] = RPCS_RECALL_SCENE; 879 msg[SRPC_CMD_ID_POS] = SRPC_RECALL_SCENE;
865 msg[SRPC_CMD_LEN_POS] = (byte) (15 + sceneName.length()); 880 msg[SRPC_CMD_LEN_POS] = (byte) (15 + sceneName.length());
866 881
867 //set ptr to point to data 882 //set ptr to point to data
@@ -899,7 +914,7 @@ public class ZigbeeSrpcClient {
899 byte msgIdx; 914 byte msgIdx;
900 915
901 //set SRPC len and CMD ID 916 //set SRPC len and CMD ID
902 msg[SRPC_CMD_ID_POS] = RPCS_IDENTIFY_DEVICE; 917 msg[SRPC_CMD_ID_POS] = SRPC_IDENTIFY_DEVICE;
903 msg[SRPC_CMD_LEN_POS] = 14; 918 msg[SRPC_CMD_LEN_POS] = 14;
904 919
905 //set ptr to point to data 920 //set ptr to point to data
@@ -917,20 +932,21 @@ public class ZigbeeSrpcClient {
917 //pad out pan ID 932 //pad out pan ID
918 msgIdx+=2; 933 msgIdx+=2;
919 934
920 //set transitionTime 935 //set transitionTime
921 msg[msgIdx++] = (byte) identifyTime; 936 msg[msgIdx++] = (byte) (identifyTime & 0xFF);
937 msg[msgIdx++] = (byte) ((identifyTime & 0xFF00)>>8);
922 938
923 sendSrpc(msg); 939 sendSrpc(msg);
924 } 940 }
925 941
926 public static void changeDeviceName(ZigbeeDevice device, String deviceName) 942 public static void changeDeviceName(ZigbeeDevice device, String deviceName)
927 { 943 {
928 byte[] msg = new byte[4 + deviceName.length()]; 944 byte[] msg = new byte[6 + deviceName.length()];
929 byte msgIdx; 945 byte msgIdx;
930 946
931 //set SRPC len and CMD ID 947 //set SRPC len and CMD ID
932 msg[SRPC_CMD_ID_POS] = RPCS_CHANGE_DEVICE_NAME; 948 msg[SRPC_CMD_ID_POS] = SRPC_CHANGE_DEVICE_NAME;
933 msg[SRPC_CMD_LEN_POS] = (byte) (2 + deviceName.length()); 949 msg[SRPC_CMD_LEN_POS] = (byte) (4 + deviceName.length());
934 950
935 //set ptr to point to data 951 //set ptr to point to data
936 msgIdx=2; 952 msgIdx=2;
@@ -938,6 +954,9 @@ public class ZigbeeSrpcClient {
938 //set afAddrMode_t nwk address 954 //set afAddrMode_t nwk address
939 msg[msgIdx++] = (byte) (device.NetworkAddr & 0xFF); 955 msg[msgIdx++] = (byte) (device.NetworkAddr & 0xFF);
940 msg[msgIdx++] = (byte) ((device.NetworkAddr & 0xFF00)>>8); 956 msg[msgIdx++] = (byte) ((device.NetworkAddr & 0xFF00)>>8);
957
958 //set EP
959 msg[msgIdx++] = (byte) (device.EndPoint);
941 960
942 msg[msgIdx++] = (byte) deviceName.length(); 961 msg[msgIdx++] = (byte) deviceName.length();
943 for(int i = 0; i < deviceName.length(); i++) 962 for(int i = 0; i < deviceName.length(); i++)
@@ -948,6 +967,29 @@ public class ZigbeeSrpcClient {
948 sendSrpc(msg); 967 sendSrpc(msg);
949 } 968 }
950 969
970
971 public static void openNetwork(byte duration)
972 {
973 byte[] msg = new byte[5];
974 byte msgIdx;
975
976 //set SRPC len and CMD ID
977 msg[SRPC_CMD_ID_POS] = SRPC_OPEN_NETWORK;
978 msg[SRPC_CMD_LEN_POS] = (byte) (3);
979
980 //set ptr to point to data
981 msgIdx=2;
982
983 //set duration
984 msg[msgIdx++] = duration;
985
986 //set join auth
987 msg[msgIdx++] = (byte) (JOIN_AUTH_NUM & 0xFF);
988 msg[msgIdx++] = (byte) ((JOIN_AUTH_NUM & 0xFF00)>>8);
989
990 sendSrpc(msg);
991 }
992
951 public static int clientConnect( ) 993 public static int clientConnect( )
952 { 994 {
953 int Port; 995 int Port;
@@ -1001,7 +1043,12 @@ public class ZigbeeSrpcClient {
1001 new Thread(new Runnable() 1043 new Thread(new Runnable()
1002 { 1044 {
1003 public void run() { 1045 public void run() {
1004 Listen(); 1046 try {
1047 Listen();
1048 } catch (IOException e) {
1049 // TODO Auto-generated catch block
1050 e.printStackTrace();
1051 }
1005 } 1052 }
1006 }).start(); 1053 }).start();
1007 1054
@@ -1028,15 +1075,36 @@ public class ZigbeeSrpcClient {
1028 1075
1029 public static void sendSrpc(byte[] msg) 1076 public static void sendSrpc(byte[] msg)
1030 { 1077 {
1031
1032 try{ 1078 try{
1033 outStream.write( msg ); 1079 outStream.write( msg );
1034 } catch (Exception e){} 1080 } catch (Exception e){}
1035 } 1081 }
1036 1082
1037 private static void Listen() { 1083 private static void Listen() throws IOException {
1038 //listen for Packets 1084 //listen for Packets
1039 while(true) 1085 while(true)
1086 {
1087 byte[] RxBuffer = new byte[1024];
1088 int bytesRead = ReadMessage(inStream, RxBuffer);
1089
1090 Log.i("Process Message:", "[" + bytesRead + "]: RPC CMD: " + RxBuffer[0] + ", RPC LEN: " + RxBuffer[1]);
1091
1092 if(bytesRead == -1)
1093 {
1094 //error
1095 }
1096 else
1097 {
1098 int bytesProcessed;
1099 bytesProcessed = rpcsProcessIncoming(RxBuffer, 0);
1100 if ( bytesRead > bytesProcessed )
1101 {
1102 //error did not process full buffer
1103 }
1104 }
1105 }
1106/*
1107 while(true)
1040 { 1108 {
1041 byte[] RxBuffer = new byte[1024]; 1109 byte[] RxBuffer = new byte[1024];
1042 try { 1110 try {
@@ -1051,7 +1119,40 @@ public class ZigbeeSrpcClient {
1051 e.printStackTrace(); 1119 e.printStackTrace();
1052 } 1120 }
1053 } 1121 }
1122*/
1054 } 1123 }
1124
1125 private static int ReadMessage(InputStream is, byte[] bytes) throws IOException {
1126 byte[] rpcHeader = new byte[2];
1127 int offset, len;
1128 int read;
1129
1130 read = is.read(rpcHeader, 0, 2);
1131 len = rpcHeader[1] + 2;
1132
1133 bytes[0] = rpcHeader[0];
1134 bytes[1] = rpcHeader[1];
1135
1136 if (read == -1) { return -1;}
1137
1138 Log.i("ReadMessage", "RPC CMD: " + rpcHeader[0] + ", RPC LEN: " + rpcHeader[1]);
1139
1140 offset = 2;
1141 while (offset < len) {
1142 read = is.read(bytes, offset, len - offset);
1143 if (read == -1) {
1144/* if ( offset == 0 ) {
1145 return -1;
1146 } else {
1147 return offset;
1148 }*/
1149 } else {
1150 offset += read;
1151 }
1152 }
1153
1154 return len;
1155 }
1055 1156
1056 public static String getGatewayIp() { 1157 public static String getGatewayIp() {
1057 return gatewayIp; 1158 return gatewayIp;
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/bindSelect.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/bindSelect.java
index 6709d54..6bd647e 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/bindSelect.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/bindSelect.java
@@ -164,11 +164,11 @@ public class bindSelect extends Activity {
164 ToggleButton idDeviceButton = (ToggleButton) findViewById(R.id.IdControllingToggle); 164 ToggleButton idDeviceButton = (ToggleButton) findViewById(R.id.IdControllingToggle);
165 if ( (idDeviceButton.isChecked()) && (currControllingDevice != null)) 165 if ( (idDeviceButton.isChecked()) && (currControllingDevice != null))
166 { 166 {
167 //ZigbeeAssistant.Identify(currControllingDevice, (short) 0x80); 167 ZigbeeAssistant.IdentifyDevice(currControllingDevice, (short) 0x80);
168 } 168 }
169 else if(currControllingDevice != null) 169 else if(currControllingDevice != null)
170 { 170 {
171 //ZigbeeAssistant.Identify(currControllingDevice, (short) 0); 171 ZigbeeAssistant.IdentifyDevice(currControllingDevice, (short) 0);
172 } 172 }
173 } 173 }
174 174
@@ -176,11 +176,11 @@ public class bindSelect extends Activity {
176 ToggleButton idDeviceButton = (ToggleButton) findViewById(R.id.IdControlledToggle); 176 ToggleButton idDeviceButton = (ToggleButton) findViewById(R.id.IdControlledToggle);
177 if ( (idDeviceButton.isChecked()) && (currControlledDevice != null)) 177 if ( (idDeviceButton.isChecked()) && (currControlledDevice != null))
178 { 178 {
179 //ZigbeeAssistant.Identify(currControlledDevice, (short) 0x80); 179 ZigbeeAssistant.IdentifyDevice(currControlledDevice, (short) 0x80);
180 } 180 }
181 else if(currControlledDevice != null) 181 else if(currControlledDevice != null)
182 { 182 {
183 //ZigbeeAssistant.Identify(currControlledDevice, (short) 0); 183 ZigbeeAssistant.IdentifyDevice(currControlledDevice, (short) 0);
184 } 184 }
185 } 185 }
186 186
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/groupSelect.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/groupSelect.java
index baa6120..97248ac 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/groupSelect.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/groupSelect.java
@@ -205,8 +205,7 @@ public class groupSelect extends Activity {
205 public void onClick(DialogInterface dialoginterface,int i){ 205 public void onClick(DialogInterface dialoginterface,int i){
206 ZigbeeAssistant.newGroup(t.getText().toString() ); 206 ZigbeeAssistant.newGroup(t.getText().toString() );
207 //set selection to the new group, which will be last as this is a new one 207 //set selection to the new group, which will be last as this is a new one
208 currGroup = groupSpinnerAdapter.getCount(); 208 currGroup = groupSpinnerAdapter.getCount();
209 new waitRspTask().execute("Create Group");
210 groupSpinner.setSelection(currGroup); 209 groupSpinner.setSelection(currGroup);
211 //update the spinner 210 //update the spinner
212 addItemsOnGroupSpinner(); 211 addItemsOnGroupSpinner();
@@ -214,75 +213,7 @@ public class groupSelect extends Activity {
214 }) 213 })
215 .setNegativeButton("Cancel", null) 214 .setNegativeButton("Cancel", null)
216 .show(); 215 .show();
217 } 216 }
218
219
220
221 class waitRspTask extends AsyncTask<String , Integer, Void>
222 {
223 private boolean rspSuccess;
224 String param;
225 @Override
226 protected void onPreExecute()
227 {
228 bar = new ProgressDialog(groupSelect.this);
229 bar.setMessage("Processing..");
230 bar.setIndeterminate(true);
231 bar.show();
232 }
233 @Override
234 protected Void doInBackground(String... params)
235 {
236 param = params[0];
237 List<ZigbeeGroup> groupList = ZigbeeAssistant.getGroups();
238 //currGroup = 0;
239 for(int i=0;i<10;i++)
240 {
241 if(currGroup < groupList.size())
242 {
243 //check if group response updated the groupId
244 if (groupList.get(currGroup).getStatus() == ZigbeeGroup.groupStatusActive)
245 {
246 rspSuccess = true;
247 return null;
248 }
249 }
250
251 try
252 {
253 Thread.sleep(500);
254 }
255 catch(Exception e)
256 {
257 System.out.println(e);
258 }
259
260 }
261
262 rspSuccess = false;
263 return null;
264 }
265 @Override
266 protected void onPostExecute(Void result)
267 {
268 bar.dismiss();
269
270 if (rspSuccess == false)
271 {
272 AlertDialog show = new AlertDialog.Builder(groupSelect.this)
273 .setTitle(param)
274 .setMessage("No response from gateway. " + param + " failed.")
275 .setPositiveButton("OK",
276 new DialogInterface.OnClickListener()
277 {
278 public void onClick(DialogInterface dialoginterface,int i){
279 }
280 })
281 .show();
282 }
283
284 }
285 }
286 217
287 218
288 public void addToGroupCmdButton(View view) { 219 public void addToGroupCmdButton(View view) {
@@ -326,11 +257,11 @@ public class groupSelect extends Activity {
326 ToggleButton idLightButton = (ToggleButton) findViewById(R.id.IdLightToggle); 257 ToggleButton idLightButton = (ToggleButton) findViewById(R.id.IdLightToggle);
327 if (idLightButton.isChecked()) 258 if (idLightButton.isChecked())
328 { 259 {
329 //ZigbeeAssistant.Identify(currDevice, (short) 0x80); 260 ZigbeeAssistant.IdentifyDevice(currDevice, (short) 0x80);
330 } 261 }
331 else 262 else
332 { 263 {
333 //ZigbeeAssistant.Identify(currDevice, (short) 0); 264 ZigbeeAssistant.IdentifyDevice(currDevice, (short) 0);
334 } 265 }
335 } 266 }
336 267
@@ -341,11 +272,11 @@ public class groupSelect extends Activity {
341 272
342 if (idGroupButton.isChecked()) 273 if (idGroupButton.isChecked())
343 { 274 {
344 //ZigbeeAssistant.Identify(group, (short) 0xFFFF); 275 ZigbeeAssistant.IdentifyGroup(group, (short) 0xFFFF);
345 } 276 }
346 else 277 else
347 { 278 {
348 //ZigbeeAssistant.Identify(group, (short) 0); 279 ZigbeeAssistant.IdentifyGroup(group, (short) 0);
349 } 280 }
350 } 281 }
351 282
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/optionsMenu.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/optionsMenu.java
index 74277d5..4424ec5 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/optionsMenu.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/optionsMenu.java
@@ -49,6 +49,4 @@ public class optionsMenu extends Activity {
49 super.onCreate(savedInstanceState); 49 super.onCreate(savedInstanceState);
50 setContentView(R.layout.optionmenu); 50 setContentView(R.layout.optionmenu);
51 } 51 }
52
53
54} \ No newline at end of file 52} \ No newline at end of file
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/sceneSelect.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/sceneSelect.java
index 4b6b2b4..25295d5 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/sceneSelect.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/sceneSelect.java
@@ -186,8 +186,7 @@ public class sceneSelect extends Activity {
186 List<ZigbeeGroup> groupList = ZigbeeAssistant.getGroups(); 186 List<ZigbeeGroup> groupList = ZigbeeAssistant.getGroups();
187 ZigbeeAssistant.newScene(t.getText().toString(), groupList.get(currGroup).getGroupId() ); 187 ZigbeeAssistant.newScene(t.getText().toString(), groupList.get(currGroup).getGroupId() );
188 //set selection to the new group, which will be last as this is a new one 188 //set selection to the new group, which will be last as this is a new one
189 currScene = sceneSpinnerAdapter.getCount(); 189 currScene = sceneSpinnerAdapter.getCount();
190 new waitRspTask().execute("Create Scene");
191 sceneSpinner.setSelection(currScene); 190 sceneSpinner.setSelection(currScene);
192 //update the spinner 191 //update the spinner
193 addItemsOnSceneSpinner(); 192 addItemsOnSceneSpinner();
@@ -195,76 +194,7 @@ public class sceneSelect extends Activity {
195 }) 194 })
196 .setNegativeButton("Cancel", null) 195 .setNegativeButton("Cancel", null)
197 .show(); 196 .show();
198 } 197 }
199
200
201
202 class waitRspTask extends AsyncTask<String , Integer, Void>
203 {
204 private boolean rspSuccess;
205 String param;
206 @Override
207 protected void onPreExecute()
208 {
209 bar = new ProgressDialog(sceneSelect.this);
210 bar.setMessage("Processing..");
211 bar.setIndeterminate(true);
212 bar.show();
213 }
214 @Override
215 protected Void doInBackground(String... params)
216 {
217 param = params[0];
218 List<ZigbeeScene> sceneList = ZigbeeAssistant.getScenes();
219 //currGroup = 0;
220 for(int i=0;i<10;i++)
221 {
222 if(currScene < sceneList.size())
223 {
224 //check if group response updated the groupId
225 if (sceneList.get(currScene).getStatus() == ZigbeeScene.sceneStatusActive)
226 {
227 rspSuccess = true;
228 return null;
229 }
230 }
231
232 try
233 {
234 Thread.sleep(500);
235 }
236 catch(Exception e)
237 {
238 System.out.println(e);
239 }
240
241 }
242
243 rspSuccess = false;
244 return null;
245 }
246 @Override
247 protected void onPostExecute(Void result)
248 {
249 bar.dismiss();
250
251 if (rspSuccess == false)
252 {
253 AlertDialog show = new AlertDialog.Builder(sceneSelect.this)
254 .setTitle(param)
255 .setMessage("No response from gateway. " + param + " failed.")
256 .setPositiveButton("OK",
257 new DialogInterface.OnClickListener()
258 {
259 public void onClick(DialogInterface dialoginterface,int i){
260 }
261 })
262 .show();
263 }
264
265 }
266 }
267
268 198
269 public void sceneStoreButton(View view) { 199 public void sceneStoreButton(View view) {
270 200
diff --git a/client/AndroidClients/LightingController/src/com/lightingcontroller/zllMain.java b/client/AndroidClients/LightingController/src/com/lightingcontroller/zllMain.java
index 79e050f..adfcc12 100644..100755
--- a/client/AndroidClients/LightingController/src/com/lightingcontroller/zllMain.java
+++ b/client/AndroidClients/LightingController/src/com/lightingcontroller/zllMain.java
@@ -44,6 +44,7 @@ import android.app.ProgressDialog;
44import android.os.AsyncTask; 44import android.os.AsyncTask;
45import android.os.Bundle; 45import android.os.Bundle;
46import android.util.DisplayMetrics; 46import android.util.DisplayMetrics;
47import android.util.Log;
47import android.view.Menu; 48import android.view.Menu;
48import android.view.MenuInflater; 49import android.view.MenuInflater;
49import android.view.MenuItem; 50import android.view.MenuItem;
@@ -72,6 +73,7 @@ import java.util.concurrent.TimeUnit;
72import com.lightingcontroller.Zigbee.ZigbeeAssistant; 73import com.lightingcontroller.Zigbee.ZigbeeAssistant;
73import com.lightingcontroller.Zigbee.ZigbeeDevice; 74import com.lightingcontroller.Zigbee.ZigbeeDevice;
74import com.lightingcontroller.Zigbee.ZigbeeGroup; 75import com.lightingcontroller.Zigbee.ZigbeeGroup;
76import com.lightingcontroller.Zigbee.ZigbeeNotification;
75import com.lightingcontroller.ColourPicker; 77import com.lightingcontroller.ColourPicker;
76 78
77public class zllMain extends Activity { 79public class zllMain extends Activity {
@@ -80,9 +82,9 @@ public class zllMain extends Activity {
80 82
81 public static ColourPicker colourPicker; 83 public static ColourPicker colourPicker;
82 private static ZigbeeGroup currGroup; 84 private static ZigbeeGroup currGroup;
83 private static ZigbeeDevice currDevice; 85 private static ZigbeeDevice currDevice = null;
84 private Spinner deviceSpinner; 86 private Spinner deviceSpinner;
85 private ArrayAdapter<String> deviceSpinnerAdapter; 87 private static ArrayAdapter<String> deviceSpinnerAdapter;
86 private int currentDeviceSpinnerSelection=0; 88 private int currentDeviceSpinnerSelection=0;
87 89
88 ProgressDialog bar; 90 ProgressDialog bar;
@@ -147,6 +149,8 @@ public class zllMain extends Activity {
147 149
148 addItemsOnDeviceSpinner(); 150 addItemsOnDeviceSpinner();
149 addListenerOnDeviceSpinnerItemSelection(); 151 addListenerOnDeviceSpinnerItemSelection();
152
153 ZigbeeNotification.init(this);
150 } 154 }
151 155
152 // add items into spinner dynamically 156 // add items into spinner dynamically
@@ -165,6 +169,11 @@ public class zllMain extends Activity {
165 { 169 {
166 deviceSpinnerAdapter.add("group: " + groupList.get(i).getGroupName()); 170 deviceSpinnerAdapter.add("group: " + groupList.get(i).getGroupName());
167 } 171 }
172
173 if( (currDevice == null) && (devList.size() > 0) )
174 {
175 currDevice = devList.get(0);
176 }
168 } 177 }
169 178
170 public void addListenerOnDeviceSpinnerItemSelection() { 179 public void addListenerOnDeviceSpinnerItemSelection() {
@@ -187,7 +196,7 @@ public class zllMain extends Activity {
187 ZigbeeAssistant.getDeviceLevel(currDevice); 196 ZigbeeAssistant.getDeviceLevel(currDevice);
188 ZigbeeAssistant.getDeviceHue(currDevice); 197 ZigbeeAssistant.getDeviceHue(currDevice);
189 ZigbeeAssistant.getDeviceSat(currDevice); 198 ZigbeeAssistant.getDeviceSat(currDevice);
190 //new waitRspTask().execute("Device Select"); 199 new waitRspTask().execute("Device Select");
191 200
192 currGroup = null; 201 currGroup = null;
193 } 202 }
@@ -243,18 +252,22 @@ public class zllMain extends Activity {
243 if( !currDevice.getCurrentStateUpdated() ) 252 if( !currDevice.getCurrentStateUpdated() )
244 { 253 {
245 ZigbeeAssistant.getDeviceState(currDevice); 254 ZigbeeAssistant.getDeviceState(currDevice);
255 try { TimeUnit.MILLISECONDS.sleep(10); } catch (InterruptedException e) {e.printStackTrace();}
246 } 256 }
247 if( !currDevice.getCurrentLevelUpdated() ) 257 if( !currDevice.getCurrentLevelUpdated() )
248 { 258 {
249 ZigbeeAssistant.getDeviceLevel(currDevice); 259 ZigbeeAssistant.getDeviceLevel(currDevice);
260 try { TimeUnit.MILLISECONDS.sleep(10); } catch (InterruptedException e) {e.printStackTrace();}
250 } 261 }
251 if( !currDevice.getCurrentHueUpdated() ) 262 if( !currDevice.getCurrentHueUpdated() )
252 { 263 {
253 ZigbeeAssistant.getDeviceHue(currDevice); 264 ZigbeeAssistant.getDeviceHue(currDevice);
265 try { TimeUnit.MILLISECONDS.sleep(10); } catch (InterruptedException e) {e.printStackTrace();}
254 } 266 }
255 if( !currDevice.getCurrentSatUpdated() ) 267 if( !currDevice.getCurrentSatUpdated() )
256 { 268 {
257 ZigbeeAssistant.getDeviceSat(currDevice); 269 ZigbeeAssistant.getDeviceSat(currDevice);
270 try { TimeUnit.MILLISECONDS.sleep(10); } catch (InterruptedException e) {e.printStackTrace();}
258 } 271 }
259 } 272 }
260 273
@@ -383,6 +396,11 @@ public class zllMain extends Activity {
383 396
384 public boolean onOptionsItemSelected(MenuItem item) { 397 public boolean onOptionsItemSelected(MenuItem item) {
385 switch (item.getItemId()) { 398 switch (item.getItemId()) {
399 case R.id.optionMenuAddDevice:
400 {
401 new addDeviceTask().execute("Add Device");
402 }
403 break;
386 case R.id.optionMenuGroups: 404 case R.id.optionMenuGroups:
387 startActivity(new Intent(zllMain.this, groupSelect.class)); 405 startActivity(new Intent(zllMain.this, groupSelect.class));
388 break; 406 break;
@@ -408,12 +426,17 @@ public class zllMain extends Activity {
408 alert = builder.create(); 426 alert = builder.create();
409 alert.show(); 427 alert.show();
410 } 428 }
411 break; 429 break;
412 } 430 }
413 return true; 431 return true;
414 } 432 }
415 433
416 public void deviceChangeNameButton(View view) 434 public void deviceChangeNameButton(View view)
435 {
436 deviceChangeName();
437 }
438
439 public void deviceChangeName()
417 { 440 {
418 String Title = "Set Name"; 441 String Title = "Set Name";
419 String Msg = "Please Enter the name of the device"; 442 String Msg = "Please Enter the name of the device";
@@ -498,4 +521,84 @@ public class zllMain extends Activity {
498 ZigbeeAssistant.setDeviceLevel(currGroup, (char) level); 521 ZigbeeAssistant.setDeviceLevel(currGroup, (char) level);
499 } 522 }
500 } 523 }
524
525 class addDeviceTask extends AsyncTask<String , Integer, Void>
526 {
527 private boolean rspSuccess;
528 int numCurrentDevices;
529 int timeoutCnt;
530 String param;
531 @Override
532 protected void onPreExecute()
533 {
534 bar = new ProgressDialog(zllMain.this);
535 bar.setMessage("Searching For New Device");
536 bar.setIndeterminate(true);
537 bar.show();
538
539 //count number of devices
540 numCurrentDevices = ZigbeeAssistant.getDevices().size();
541
542 //open network
543 ZigbeeAssistant.openNetwork((byte)60);
544
545 }
546 @Override
547 protected Void doInBackground(String... params)
548 {
549 param = params[0];
550
551 //30s time out
552 for(timeoutCnt = 0; timeoutCnt < 60; timeoutCnt++)
553 {
554 try { TimeUnit.MILLISECONDS.sleep(500); } catch (InterruptedException e) {e.printStackTrace();}
555
556 if( ZigbeeAssistant.getDevices().size() > numCurrentDevices)
557 {
558 rspSuccess = true;
559 return null;
560 }
561 }
562
563 rspSuccess = false;
564 return null;
565 }
566 @Override
567 protected void onPostExecute(Void result)
568 {
569 bar.dismiss();
570
571 if (rspSuccess == false)
572 {
573 AlertDialog show = new AlertDialog.Builder(zllMain.this)
574 .setTitle(param)
575 .setMessage("No new devices found\n")
576 .setPositiveButton("OK",
577 new DialogInterface.OnClickListener()
578 {
579 public void onClick(DialogInterface dialoginterface,int i){
580 }
581 })
582 .show();
583 }
584 else
585 {
586 //Let notification change the name
587 }
588 }
589 }
590
591 public static void setCurrentDevice(ZigbeeDevice device)
592 {
593 currDevice = device;
594 deviceSpinnerAdapter.clear();
595 List<ZigbeeDevice> tList = ZigbeeAssistant.getDevices();
596 for (int j = 0 ; j < tList.size() ; j++)
597 {
598 if (tList.get(j).hasColourable || tList.get(j).hasSwitchable || tList.get(j).hasDimmable)
599 {
600 deviceSpinnerAdapter.add(tList.get(j).Name);
601 }
602 }
603 }
501} \ No newline at end of file 604} \ No newline at end of file
diff --git a/client/CClients/Source/socket_client.c b/client/CClients/Source/socket_client.c
index 7e6241c..7e6241c 100644..100755
--- a/client/CClients/Source/socket_client.c
+++ b/client/CClients/Source/socket_client.c
diff --git a/client/CClients/Source/socket_client.h b/client/CClients/Source/socket_client.h
index e8baae8..e8baae8 100644..100755
--- a/client/CClients/Source/socket_client.h
+++ b/client/CClients/Source/socket_client.h
diff --git a/client/CClients/lightFlashCmdLine/Source/flashled.c b/client/CClients/lightFlashCmdLine/Source/flashled.c
index 9273277..12e6228 100644..100755
--- a/client/CClients/lightFlashCmdLine/Source/flashled.c
+++ b/client/CClients/lightFlashCmdLine/Source/flashled.c
@@ -3,7 +3,7 @@
3 Revised: $Date: 2012-03-21 17:37:33 -0700 (Wed, 21 Mar 2012) $ 3 Revised: $Date: 2012-03-21 17:37:33 -0700 (Wed, 21 Mar 2012) $
4 Revision: $Revision: 246 $ 4 Revision: $Revision: 246 $
5 5
6 Description: This file contains an example client for the zllGateway sever 6 Description: This file contains an example client for the zbGateway sever
7 7
8 Copyright (C) {2012} Texas Instruments Incorporated - http://www.ti.com/ 8 Copyright (C) {2012} Texas Instruments Incorporated - http://www.ti.com/
9 9
@@ -59,11 +59,11 @@ int keyFd;
59#define CONSOLEDEVICE "/dev/console" 59#define CONSOLEDEVICE "/dev/console"
60 60
61void sendLightState(uint16_t addr, uint16_t addrMode, uint16_t ep, uint8_t state); 61void sendLightState(uint16_t addr, uint16_t addrMode, uint16_t ep, uint8_t state);
62void socketClientZllCb( msgData_t *msg ); 62void socketClientCb( msgData_t *msg );
63 63
64typedef uint8_t (*rpcsProcessMsg_t)(msgData_t *msg); 64typedef uint8_t (*srpcProcessMsg_t)(msgData_t *msg);
65 65
66rpcsProcessMsg_t rpcsProcessSeIncoming[] = 66srpcProcessMsg_t rpcsProcessSeIncoming[] =
67{ 67{
68}; 68};
69 69
@@ -77,8 +77,9 @@ int main(int argc, char *argv[])
77{ 77{
78 uint16_t addr, period, loops; 78 uint16_t addr, period, loops;
79 uint8_t addrMode, ep, cnt=0; 79 uint8_t addrMode, ep, cnt=0;
80 uint32 start_with = 0;
80 81
81 if(argc != 6) 82 if(argc < 6)
82 { 83 {
83 printf("Expected 4 and got %d params Usage: %s <device/group addr> <addr mode> <ep> <periodms> <loops>\n", argc, argv[0] ); 84 printf("Expected 4 and got %d params Usage: %s <device/group addr> <addr mode> <ep> <periodms> <loops>\n", argc, argv[0] );
84 printf("Example - Unicast command of nwk addr 0xb85a ep 0xb every 1s: %s 0xb85a 2 0xb 1000 0\n", argv[0] ); 85 printf("Example - Unicast command of nwk addr 0xb85a ep 0xb every 1s: %s 0xb85a 2 0xb 1000 0\n", argv[0] );
@@ -101,9 +102,15 @@ int main(int argc, char *argv[])
101 102
102 sscanf(argv[5], "%d", &tmpInt); 103 sscanf(argv[5], "%d", &tmpInt);
103 loops = (uint16_t) tmpInt; 104 loops = (uint16_t) tmpInt;
105
106 if (argc > 6)
107 {
108 start_with = atoi(argv[6]);
109 }
110
104 } 111 }
105 112
106 socketClientInit("127.0.0.1:11235", socketClientZllCb); 113 socketClientInit("127.0.0.1:11235", socketClientCb);
107 114
108 if(loops != 0) 115 if(loops != 0)
109 loops+=2; 116 loops+=2;
@@ -112,13 +119,13 @@ int main(int argc, char *argv[])
112 while(loops != 2) 119 while(loops != 2)
113 { 120 {
114 printf("Toggling Light %x:%x - %d\n", addr, ep, cnt++ ); 121 printf("Toggling Light %x:%x - %d\n", addr, ep, cnt++ );
115 if((loops % 2) ==0) 122 if((loops % 2) == start_with)
116 { 123 {
117 sendLightState(addr, addrMode, ep, 0); 124 sendLightState(addr, addrMode, ep, 1);
118 } 125 }
119 else 126 else
120 { 127 {
121 sendLightState(addr, addrMode, ep, 1); 128 sendLightState(addr, addrMode, ep, 0);
122 } 129 }
123 130
124 usleep(period * 1000); 131 usleep(period * 1000);
@@ -135,7 +142,7 @@ int main(int argc, char *argv[])
135} 142}
136 143
137//Process the message from HA-Interface 144//Process the message from HA-Interface
138void socketClientZllCb( msgData_t *msg ) 145void socketClientCb( msgData_t *msg )
139{ 146{
140 //for now we are not interested in messages from HA server 147 //for now we are not interested in messages from HA server
141} 148}
@@ -145,7 +152,7 @@ void sendLightState(uint16_t addr, uint16_t addrMode, uint16_t ep, uint8_t state
145 msgData_t msg; 152 msgData_t msg;
146 uint8_t* pRpcCmd = msg.pData; 153 uint8_t* pRpcCmd = msg.pData;
147 154
148 msg.cmdId = RPCS_SET_DEV_STATE; 155 msg.cmdId = SRPC_SET_DEV_STATE;
149 msg.len = 15; 156 msg.len = 15;
150 //Addr Mode 157 //Addr Mode
151 *pRpcCmd++ = (afAddrMode_t)addrMode; 158 *pRpcCmd++ = (afAddrMode_t)addrMode;
diff --git a/client/CClients/lightFlashCmdLine/i486-linux-gnu/makefile b/client/CClients/lightFlashCmdLine/i486-linux-gnu/makefile
index 8d799d3..8d799d3 100644..100755
--- a/client/CClients/lightFlashCmdLine/i486-linux-gnu/makefile
+++ b/client/CClients/lightFlashCmdLine/i486-linux-gnu/makefile
diff --git a/client/CClients/listDevsCmdLine/Source/listdevs.c b/client/CClients/listDevsCmdLine/Source/listdevs.c
index 6128911..27b0afd 100644..100755
--- a/client/CClients/listDevsCmdLine/Source/listdevs.c
+++ b/client/CClients/listDevsCmdLine/Source/listdevs.c
@@ -1,42 +1,42 @@
1 /************************************************************************************************** 1/**************************************************************************************************
2 Filename: flashled.c 2 Filename: flashled.c
3 Revised: $Date: 2012-03-21 17:37:33 -0700 (Wed, 21 Mar 2012) $ 3 Revised: $Date: 2012-03-21 17:37:33 -0700 (Wed, 21 Mar 2012) $
4 Revision: $Revision: 246 $ 4 Revision: $Revision: 246 $
5 5