Merge "C++ SDK Adding OCConnectivity Type" into connectivity-abstraction
[platform/upstream/iotivity.git] / resource / include / OCPlatform_impl.h
index 896ce3a..6f7ca58 100644 (file)
@@ -140,10 +140,40 @@ namespace OC
         * as BTH etc.
         * NOTE: OCStackResult is defined in ocstack.h.
         */
+#ifdef CA_INT
+        OCStackResult findResource(const std::string& host, const std::string& resourceURI,
+                    OCConnectivityType connectivityType, FindCallback resourceHandler);
+        OCStackResult findResource(const std::string& host, const std::string& resourceURI,
+                    OCConnectivityType connectivityType, FindCallback resourceHandler,
+                    QualityOfService QoS);
+#else
         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
                     FindCallback resourceHandler);
         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
                     FindCallback resourceHandler, QualityOfService QoS);
+#endif
+        /**
+         * API for Device Discovery
+         *
+         * @param host - Host IP Address. If null or empty, Multicast is performed.
+         * @param resourceURI - Uri containing address to the virtual device in C Stack
+         *                       ("/oc/core/d")
+         *
+         * @param QualityOfService the quality of communication
+         *
+         */
+#ifdef CA_INT
+        OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
+                    OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler);
+        OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
+                    OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler,
+                    QualityOfService QoS);
+#else
+        OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
+                    FindDeviceCallback deviceInfoHandler);
+        OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
+                    FindDeviceCallback deviceInfoHandler, QualityOfService QoS);
+#endif
 
         /**
         * This API registers a resource with the server
@@ -193,6 +223,17 @@ namespace OC
                         const std::shared_ptr<OCResource> resource);
 
         /**
+         * This API registers all the device specific information
+         *
+         * @param OCDeviceInfo - Structure containing all the device related information
+         *
+         * @return OCStackResult return value of the API. Returns OC_STACK_OK if success
+         *
+         * Note: OCDeviceInfo is defined in OCStack.h
+         */
+        OCStackResult registerDeviceInfo(const OCDeviceInfo deviceInfo);
+
+        /**
         * Set default device entity handler
         *
         * @param entityHandler - entity handler to handle requests for
@@ -377,11 +418,18 @@ namespace OC
         *
         * @return OCStackResult - return value of the API.  Returns OCSTACK_OK if success <br>
         */
+#ifdef CA_INT
+        OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
+                        OCConnectivityType connectivityType, SubscribeCallback presenceHandler);
+        OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
+                        const std::string& resourceType, OCConnectivityType connectivityType,
+                        SubscribeCallback presenceHandler);
+#else
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
                         SubscribeCallback presenceHandler);
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
                         const std::string& resourceType, SubscribeCallback presenceHandler);
-
+#endif
         /**
         * unsubscribes from a previously subscribed server's presence events. Note that
         * you may for a short time still receive events from the server since it may take time
@@ -419,10 +467,16 @@ namespace OC
         * @param interfaces - a collection of interfaces that the resource supports/implements
         * @return OCResource::Ptr - a shared pointer to the new resource object
         */
+#ifdef CA_INT
+        OCResource::Ptr constructResourceObject(const std::string& host, const std::string& uri,
+                        OCConnectivityType connectivityType, bool isObservable,
+                        const std::vector<std::string>& resourceTypes,
+                        const std::vector<std::string>& interfaces);
+#else
         OCResource::Ptr constructResourceObject(const std::string& host, const std::string& uri,
                         bool isObservable, const std::vector<std::string>& resourceTypes,
                         const std::vector<std::string>& interfaces);
-
+#endif
         /**
         * Allows application entity handler to send response to an incoming request.
         *