Enable discovery in Zigbee plugin in IoTivity's Plugin Interface module.
authorJoseph Morrow <joseph.l.morrow@intel.com>
Mon, 5 Dec 2016 17:33:11 +0000 (09:33 -0800)
committerUze Choi <uzchoi@samsung.com>
Tue, 31 Jan 2017 02:31:27 +0000 (02:31 +0000)
The PISetup() API needed to be called. It was never being called from the
sample application. Therefore no one knew how to perform the discovery.
This should unblock anyone looking to use this plugin.

Change-Id: Idcb269a48958ee3b262356a054c78ca6e0109315
Signed-off-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15165
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
plugins/samples/linux/IotivityandZigbeeServer.c

index 0abd561..d239205 100644 (file)
@@ -84,6 +84,15 @@ int main()
     }
     else
     {
+        OIC_LOG(INFO, TAG, "Performing Zigbee discovery. This process takes 15 seconds.");
+
+        result = PISetup(plugin);
+        if (result != OC_STACK_OK)
+        {
+            OIC_LOG_V(ERROR, TAG, "Zigbee Plugin Discovery Failed: %d", result);
+            goto IotivityStop;
+        }
+
         OIC_LOG(INFO, TAG, "Zigbee Plugin started correctly, press Ctrl-C to terminate application");
         // Loop until sigint
         while (!processSignal(false) && result == OC_STACK_OK)