replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / examples / rdclient.cpp
index 0b9eeb5..7e20559 100644 (file)
@@ -62,10 +62,18 @@ public:
 
         m_resourceUri = resourceURI;
 
-        OCPlatform::registerResource(m_resourceHandle, resourceURI, resourceTypeName,
-                                     resourceInterface,
-                                     nullptr,
-                                     OC_DISCOVERABLE);
+        OCStackResult ret = OCPlatform::registerResource(m_resourceHandle,
+                                                         resourceURI,
+                                                         resourceTypeName,
+                                                         resourceInterface,
+                                                         nullptr,
+                                                         OC_DISCOVERABLE);
+
+        if (OC_STACK_OK != ret)
+        {
+            cout << "Resource creation was unsuccessful\n";
+            return;
+        }
 
         m_publishedResourceHandles.push_back(m_resourceHandle);
         cout << "registerResource is called." << endl;
@@ -229,7 +237,7 @@ int main(int argc, char* argv[])
         return -1;
     }
 
-    OCPersistentStorage ps {client_open, fread, fwrite, fclose, unlink };
+    OCPersistentStorage ps {client_open, fread, fwrite, fclose, unlink, NULL, NULL};
     PlatformConfig config
     { OC::ServiceType::InProc, ModeType::Both, "0.0.0.0", 0, OC::QualityOfService::LowQos, &ps};