[JIRA Issue - 1092] IoTivity Zigbee sample application wrongly freeing memory
[platform/upstream/iotivity.git] / plugins / samples / linux / IotivityandZigbeeServer.c
index 30a8c79..b978074 100644 (file)
@@ -22,6 +22,8 @@
 #include <signal.h>
 #include <ocstack.h>
 #include <logger.h>
+#include "oic_string.h"
+#include "oic_malloc.h"
 
 #define TAG "IoTivityZigbeeServer"
 #define defaultComPort "/dev/ttyUSB0"
@@ -134,11 +136,15 @@ OCStackResult SetPlatformInfo()
 
 OCStackResult SetDeviceInfo()
 {
-    static const OCDeviceInfo deviceInfo =
+    static OCDeviceInfo deviceInfo =
         {
-            .deviceName = "IoTivity/Zigbee Server Sample"
+            .deviceName = "IoTivity/Zigbee Server Sample",
+            .specVersion = "IoTivity/Zigbee Device Spec Version",
+            .dataModleVersion = "IoTivity/Zigbee Data Model Version",
         };
-
+    char *dup = OICStrdup("oic.wk.d");
+    deviceInfo.types = (OCStringLL *)OICCalloc(1, sizeof(OCStringLL));
+    deviceInfo.types->value = dup;
     return OCSetDeviceInfo(deviceInfo);
 }
 
@@ -160,4 +166,3 @@ void processCancel(int signal)
         processSignal(true);
     }
 }
-