C++ SDK Adding OCConnectivity Type
authoromkar <omkar.m.hegde@intel.com>
Wed, 14 Jan 2015 02:11:27 +0000 (18:11 -0800)
committerOmkar Hegde <omkar.m.hegde@intel.com>
Fri, 16 Jan 2015 16:38:14 +0000 (16:38 +0000)
Previously, we had connectivity type being passed as a
unsigned integer in the C++ SDK. Changing that to
OCConnectivity type.

Change-Id: I5f1690cc0295a2448515d7681a792eb6f6f5811c
Signed-off-by: omkar <omkar.m.hegde@intel.com>
resource/include/IClientWrapper.h
resource/include/InProcClientWrapper.h
resource/include/OCPlatform.h
resource/include/OCPlatform_impl.h
resource/include/OCResource.h
resource/include/OCSerialization.h
resource/include/OutOfProcClientWrapper.h
resource/src/InProcClientWrapper.cpp
resource/src/OCPlatform.cpp
resource/src/OCPlatform_impl.cpp
resource/src/OCResource.cpp

index 31a9591..5ce6395 100644 (file)
@@ -42,41 +42,42 @@ namespace OC
 
 #ifdef CA_INT
         virtual OCStackResult ListenForResource(const std::string& serviceUrl,
-                        const std::string& resourceType, uint8_t connectivityType,
+                        const std::string& resourceType, OCConnectivityType connectivityType,
                         FindCallback& callback,
                         QualityOfService QoS) = 0;
 
         virtual OCStackResult ListenForDevice(const std::string& serviceUrl,
-                        const std::string& deviceURI, uint8_t connectivityType,
+                        const std::string& deviceURI, OCConnectivityType connectivityType,
                         FindDeviceCallback& callback,
                         QualityOfService QoS) = 0;
 
         virtual OCStackResult GetResourceRepresentation(const std::string& host,
-                        const std::string& uri, uint8_t connectivityType,
+                        const std::string& uri, OCConnectivityType connectivityType,
                         const QueryParamsMap& queryParams,
                         const HeaderOptions& headerOptions,
                         GetCallback& callback, QualityOfService QoS)=0;
 
         virtual OCStackResult PutResourceRepresentation(const std::string& host,
-                        const std::string& uri, uint8_t connectivityType,
+                        const std::string& uri, OCConnectivityType connectivityType,
                         const OCRepresentation& rep, const QueryParamsMap& queryParams,
                         const HeaderOptions& headerOptions,
                         PutCallback& callback, QualityOfService QoS) = 0;
 
         virtual OCStackResult PostResourceRepresentation(const std::string& host,
-                        const std::string& uri, uint8_t connectivityType,
+                        const std::string& uri, OCConnectivityType connectivityType,
                         const OCRepresentation& rep, const QueryParamsMap& queryParams,
                         const HeaderOptions& headerOptions,
                         PostCallback& callback, QualityOfService QoS) = 0;
 
         virtual OCStackResult DeleteResource(const std::string& host, const std::string& uri,
-                        uint8_t connectivityType, const HeaderOptions& headerOptions,
+                        OCConnectivityType connectivityType, const HeaderOptions& headerOptions,
                         DeleteCallback& callback, QualityOfService QoS) = 0;
 
         virtual OCStackResult ObserveResource(ObserveType observeType, OCDoHandle* handle,
-                        const std::string& host, const std::string& uri, uint8_t connectivityType,
-                        const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
-                        ObserveCallback& callback, QualityOfService QoS)=0;
+                        const std::string& host, const std::string& uri,
+                        OCConnectivityType connectivityType, const QueryParamsMap& queryParams,
+                        const HeaderOptions& headerOptions, ObserveCallback& callback,
+                        QualityOfService QoS)=0;
 #else
         virtual OCStackResult ListenForResource(const std::string& serviceUrl,
                         const std::string& resourceType, FindCallback& callback,
@@ -115,7 +116,7 @@ namespace OC
 
 #ifdef CA_INT
         virtual OCStackResult SubscribePresence(OCDoHandle* handle, const std::string& host,
-                        const std::string& resourceType, uint8_t connectivityType,
+                        const std::string& resourceType, OCConnectivityType connectivityType,
                         SubscribeCallback& presenceHandler)=0;
 #else
         virtual OCStackResult SubscribePresence(OCDoHandle* handle, const std::string& host,
index 0d29b9d..f7351c6 100644 (file)
@@ -85,34 +85,34 @@ namespace OC
 
 #ifdef CA_INT
         virtual OCStackResult ListenForResource(const std::string& serviceUrl,
-            const std::string& resourceType, uint8_t connectivityType, FindCallback& callback,
-            QualityOfService QoS);
+            const std::string& resourceType, OCConnectivityType connectivityType,
+            FindCallback& callback, QualityOfService QoS);
 
         virtual OCStackResult ListenForDevice(const std::string& serviceUrl,
-            const std::string& deviceURI, uint8_t connectivityType, FindDeviceCallback& callback,
-            QualityOfService QoS);
+            const std::string& deviceURI, OCConnectivityType connectivityType,
+            FindDeviceCallback& callback, QualityOfService QoS);
 
         virtual OCStackResult GetResourceRepresentation(const std::string& host,
-            const std::string& uri, uint8_t connectivityType, const QueryParamsMap& queryParams,
-            const HeaderOptions& headerOptions,
+            const std::string& uri, OCConnectivityType connectivityType,
+            const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
             GetCallback& callback, QualityOfService QoS);
 
         virtual OCStackResult PutResourceRepresentation(const std::string& host,
-            const std::string& uri, uint8_t connectivityType, const OCRepresentation& attributes,
-            const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
-            PutCallback& callback, QualityOfService QoS);
+            const std::string& uri, OCConnectivityType connectivityType,
+            const OCRepresentation& attributes, const QueryParamsMap& queryParams,
+            const HeaderOptions& headerOptions, PutCallback& callback, QualityOfService QoS);
 
         virtual OCStackResult PostResourceRepresentation(const std::string& host,
-            const std::string& uri, uint8_t connectivityType, const OCRepresentation& attributes,
-            const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
-            PostCallback& callback, QualityOfService QoS);
+            const std::string& uri, OCConnectivityType connectivityType,
+            const OCRepresentation& attributes, const QueryParamsMap& queryParams,
+            const HeaderOptions& headerOptions, PostCallback& callback, QualityOfService QoS);
 
         virtual OCStackResult DeleteResource(const std::string& host, const std::string& uri,
-            uint8_t connectivityType, const HeaderOptions& headerOptions,
+            OCConnectivityType connectivityType, const HeaderOptions& headerOptions,
             DeleteCallback& callback, QualityOfService QoS);
 
         virtual OCStackResult ObserveResource(ObserveType observeType, OCDoHandle* handle,
-            const std::string& host, const std::string& uri, uint8_t connectivityType,
+            const std::string& host, const std::string& uri, OCConnectivityType connectivityType,
             const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
             ObserveCallback& callback, QualityOfService QoS);
 #else
@@ -151,7 +151,7 @@ namespace OC
 
 #ifdef CA_INT
         virtual OCStackResult SubscribePresence(OCDoHandle* handle, const std::string& host,
-            const std::string& resourceType, uint8_t connectivityType,
+            const std::string& resourceType, OCConnectivityType connectivityType,
             SubscribeCallback& presenceHandler);
 #else
         virtual OCStackResult SubscribePresence(OCDoHandle* handle, const std::string& host,
index d83dc67..79ab4b6 100644 (file)
@@ -116,9 +116,10 @@ namespace OC
         */
 #ifdef CA_INT
         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
-                    uint8_t connectivityType, FindCallback resourceHandler);
+                    OCConnectivityType connectivityType, FindCallback resourceHandler);
         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
-                    uint8_t connectivityType, FindCallback resourceHandler, QualityOfService QoS);
+                    OCConnectivityType connectivityType, FindCallback resourceHandler,
+                    QualityOfService QoS);
 #endif
         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
                     FindCallback resourceHandler);
@@ -136,9 +137,9 @@ namespace OC
          */
 #ifdef CA_INT
         OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
-                    uint8_t connectivityType, FindDeviceCallback deviceInfoHandler);
+                    OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler);
         OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
-                    uint8_t connectivityType, FindDeviceCallback deviceInfoHandler,
+                    OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler,
                     QualityOfService QoS);
 #endif
         OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
@@ -395,9 +396,9 @@ namespace OC
         */
 #ifdef CA_INT
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
-                        uint8_t connectivityType, SubscribeCallback presenceHandler);
+                        OCConnectivityType connectivityType, SubscribeCallback presenceHandler);
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
-                        const std::string& resourceType, uint8_t connectivityType,
+                        const std::string& resourceType, OCConnectivityType connectivityType,
                         SubscribeCallback presenceHandler);
 #endif
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
@@ -443,7 +444,7 @@ namespace OC
         */
 #ifdef CA_INT
         OCResource::Ptr constructResourceObject(const std::string& host, const std::string& uri,
-                        uint8_t connectivityType, bool isObservable,
+                        OCConnectivityType connectivityType, bool isObservable,
                         const std::vector<std::string>& resourceTypes,
                         const std::vector<std::string>& interfaces);
 #endif
index 46bc9d9..6f7ca58 100644 (file)
@@ -142,9 +142,10 @@ namespace OC
         */
 #ifdef CA_INT
         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
-                    uint8_t connectivityType, FindCallback resourceHandler);
+                    OCConnectivityType connectivityType, FindCallback resourceHandler);
         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
-                    uint8_t connectivityType, FindCallback resourceHandler, QualityOfService QoS);
+                    OCConnectivityType connectivityType, FindCallback resourceHandler,
+                    QualityOfService QoS);
 #else
         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
                     FindCallback resourceHandler);
@@ -163,9 +164,9 @@ namespace OC
          */
 #ifdef CA_INT
         OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
-                    uint8_t connectivityType, FindDeviceCallback deviceInfoHandler);
+                    OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler);
         OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
-                    uint8_t connectivityType, FindDeviceCallback deviceInfoHandler,
+                    OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler,
                     QualityOfService QoS);
 #else
         OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
@@ -419,9 +420,9 @@ namespace OC
         */
 #ifdef CA_INT
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
-                        uint8_t connectivityType, SubscribeCallback presenceHandler);
+                        OCConnectivityType connectivityType, SubscribeCallback presenceHandler);
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
-                        const std::string& resourceType, uint8_t connectivityType,
+                        const std::string& resourceType, OCConnectivityType connectivityType,
                         SubscribeCallback presenceHandler);
 #else
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
@@ -468,7 +469,7 @@ namespace OC
         */
 #ifdef CA_INT
         OCResource::Ptr constructResourceObject(const std::string& host, const std::string& uri,
-                        uint8_t connectivityType, bool isObservable,
+                        OCConnectivityType connectivityType, bool isObservable,
                         const std::vector<std::string>& resourceTypes,
                         const std::vector<std::string>& interfaces);
 #else
index 5846994..5a09fbf 100644 (file)
@@ -317,7 +317,7 @@ namespace OC
         * Function to get the connectivity type of this resource
         * @return uint8_t connectivity type
         */
-        uint8_t connectivityType() const;
+        OCConnectivityType connectivityType() const;
 #endif
 
         /**
@@ -384,7 +384,7 @@ namespace OC
         OCResourceIdentifier m_resourceId;
         std::string m_host;
 #ifdef CA_INT
-        uint8_t m_connectivityType;
+        OCConnectivityType m_connectivityType;
 #endif
         bool m_isObservable;
         bool m_isCollection;
@@ -397,8 +397,9 @@ namespace OC
     private:
 #ifdef CA_INT
         OCResource(std::weak_ptr<IClientWrapper> clientWrapper, const std::string& host,
-            const std::string& uri, const std::string& serverId, uint8_t m_connectivityType,
-            bool observable, const std::vector<std::string>& resourceTypes,
+            const std::string& uri, const std::string& serverId,
+            OCConnectivityType m_connectivityType, bool observable,
+            const std::vector<std::string>& resourceTypes,
             const std::vector<std::string>& interfaces);
 #else
         OCResource(std::weak_ptr<IClientWrapper> clientWrapper, const std::string& host,
index b0bf50a..8ab3426 100644 (file)
@@ -188,7 +188,7 @@ namespace OC
         public:
 #ifdef CA_INT
             ListenOCContainer(std::weak_ptr<IClientWrapper> cw, const OCDevAddr& address,
-                    uint8_t connectivityType, std::stringstream& json):
+                    OCConnectivityType connectivityType, std::stringstream& json):
                 m_clientWrapper(cw), m_address(address), m_connectivityType(connectivityType)
 #else
             ListenOCContainer(std::weak_ptr<IClientWrapper> cw, const OCDevAddr& address,
@@ -300,6 +300,6 @@ namespace OC
             std::vector<std::shared_ptr<OC::OCResource>> m_resources;
             std::weak_ptr<IClientWrapper> m_clientWrapper;
             OCDevAddr m_address;
-            uint8_t m_connectivityType;
+            OCConnectivityType m_connectivityType;
     };
 }
index 0654a36..6b54748 100644 (file)
@@ -34,40 +34,41 @@ namespace OC
 
 #ifdef CA_INT
         virtual OCStackResult ListenForResource(const std::string& serviceUrl,
-            const std::string& resourceType, uint8_t connectivityType,
+            const std::string& resourceType, OCConnectivityType connectivityType,
             FindCallback& callback, QualityOfService QoS)
             {return OC_STACK_NOTIMPL;}
 
         virtual OCStackResult ListenForDevice(const std::string& serviceUrl,
-            const std::string& deviceURI, uint8_t connectivityType, FindDeviceCallback& callback,
-            QualityOfService QoS)
+            const std::string& deviceURI, OCConnectivityType connectivityType,
+            FindDeviceCallback& callback, QualityOfService QoS)
             {return OC_STACK_NOTIMPL;}
 
         virtual OCStackResult GetResourceRepresentation(const std::string& host,
-            const std::string& uri, uint8_t connectivityType, const QueryParamsMap& queryParams,
-            const HeaderOptions& headerOptions, GetCallback& callback,
-            QualityOfService QoS)
+            const std::string& uri, OCConnectivityType connectivityType,
+            const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
+            GetCallback& callback, QualityOfService QoS)
             {return OC_STACK_NOTIMPL;}
 
         virtual OCStackResult PutResourceRepresentation(const std::string& host,
-            const std::string& uri, uint8_t connectivityType, const OCRepresentation& attributes,
-            const QueryParamsMap& queryParams,
+            const std::string& uri, OCConnectivityType connectivityType,
+            const OCRepresentation& attributes, const QueryParamsMap& queryParams,
             const HeaderOptions& headerOptions, PutCallback& callback,
             QualityOfService QoS)
             {return OC_STACK_NOTIMPL;}
 
         virtual OCStackResult PostResourceRepresentation(const std::string& host,
-            const std::string& uri, uint8_t connectivityType, const OCRepresentation& attributes,
-            const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
-            PostCallback& callback, QualityOfService QoS)
+            const std::string& uri, OCConnectivityType connectivityType,
+            const OCRepresentation& attributes, const QueryParamsMap& queryParams,
+            const HeaderOptions& headerOptions, PostCallback& callback, QualityOfService QoS)
             {return OC_STACK_NOTIMPL;}
 
         virtual OCStackResult DeleteResource(const std::string& host, const std::string& uri,
-            uint8_t connectivityType, const HeaderOptions& headerOptions, DeleteCallback& callback,
-            QualityOfService QoS) {return OC_STACK_NOTIMPL;}
+            OCConnectivityType connectivityType, const HeaderOptions& headerOptions,
+            DeleteCallback& callback, QualityOfService QoS)
+            {return OC_STACK_NOTIMPL;}
 
         virtual OCStackResult ObserveResource(ObserveType observeType, OCDoHandle* handle,
-            const std::string& host, const std::string& uri, uint8_t connectivityType,
+            const std::string& host, const std::string& uri, OCConnectivityType connectivityType,
             const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
             ObserveCallback& callback, QualityOfService QoS){return OC_STACK_NOTIMPL;}
 #else
@@ -113,7 +114,7 @@ namespace OC
             const HeaderOptions& headerOptions, QualityOfService QoS){return OC_STACK_NOTIMPL;}
 #ifdef CA_INT
         virtual OCStackResult SubscribePresence(OCDoHandle* handle, const std::string& host,
-            const std::string& resourceType, uint8_t connectivityType,
+            const std::string& resourceType, OCConnectivityType connectivityType,
             SubscribeCallback& presenceHandler)
         {return OC_STACK_NOTIMPL;}
 #else
index c2762bf..1d9d439 100644 (file)
@@ -181,7 +181,7 @@ namespace OC
 
 #ifdef CA_INT
     OCStackResult InProcClientWrapper::ListenForResource(const std::string& serviceUrl,
-        const std::string& resourceType, uint8_t connectivityType,
+        const std::string& resourceType, OCConnectivityType connectivityType,
         FindCallback& callback, QualityOfService QoS)
 #else
     OCStackResult InProcClientWrapper::ListenForResource(const std::string& serviceUrl,
@@ -244,7 +244,7 @@ namespace OC
 
 #ifdef CA_INT
     OCStackResult InProcClientWrapper::ListenForDevice(const std::string& serviceUrl,
-        const std::string& deviceURI, uint8_t connectivityType,
+        const std::string& deviceURI, OCConnectivityType connectivityType,
         FindDeviceCallback& callback, QualityOfService QoS)
 #else
     OCStackResult InProcClientWrapper::ListenForDevice(const std::string& serviceUrl,
@@ -337,9 +337,9 @@ namespace OC
 
 #ifdef CA_INT
     OCStackResult InProcClientWrapper::GetResourceRepresentation(const std::string& host,
-        const std::string& uri, uint8_t connectivityType, const QueryParamsMap& queryParams,
-        const HeaderOptions& headerOptions, GetCallback& callback,
-        QualityOfService QoS)
+        const std::string& uri, OCConnectivityType connectivityType,
+        const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
+        GetCallback& callback, QualityOfService QoS)
 #else
     OCStackResult InProcClientWrapper::GetResourceRepresentation(const std::string& host,
         const std::string& uri, const QueryParamsMap& queryParams,
@@ -450,7 +450,7 @@ namespace OC
 
 #ifdef CA_INT
     OCStackResult InProcClientWrapper::PostResourceRepresentation(const std::string& host,
-        const std::string& uri, uint8_t connectivityType, const OCRepresentation& rep,
+        const std::string& uri, OCConnectivityType connectivityType, const OCRepresentation& rep,
         const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
         PostCallback& callback, QualityOfService QoS)
 #else
@@ -508,7 +508,7 @@ namespace OC
 
 #ifdef CA_INT
     OCStackResult InProcClientWrapper::PutResourceRepresentation(const std::string& host,
-        const std::string& uri, uint8_t connectivityType, const OCRepresentation& rep,
+        const std::string& uri, OCConnectivityType connectivityType, const OCRepresentation& rep,
         const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
         PutCallback& callback, QualityOfService QoS)
 #else
@@ -584,8 +584,8 @@ namespace OC
 
 #ifdef CA_INT
     OCStackResult InProcClientWrapper::DeleteResource(const std::string& host,
-        const std::string& uri, uint8_t connectivityType, const HeaderOptions& headerOptions,
-         DeleteCallback& callback, QualityOfService QoS)
+        const std::string& uri, OCConnectivityType connectivityType,
+        const HeaderOptions& headerOptions, DeleteCallback& callback, QualityOfService QoS)
 #else
     OCStackResult InProcClientWrapper::DeleteResource(const std::string& host,
         const std::string& uri, const HeaderOptions& headerOptions,
@@ -658,7 +658,7 @@ namespace OC
 
 #ifdef CA_INT
     OCStackResult InProcClientWrapper::ObserveResource(ObserveType observeType, OCDoHandle* handle,
-        const std::string& host, const std::string& uri, uint8_t connectivityType,
+        const std::string& host, const std::string& uri, OCConnectivityType connectivityType,
         const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
         ObserveCallback& callback, QualityOfService QoS)
 #else
@@ -780,8 +780,8 @@ namespace OC
 
 #ifdef CA_INT
     OCStackResult InProcClientWrapper::SubscribePresence(OCDoHandle* handle,
-        const std::string& host, const std::string& resourceType, uint8_t connectivityType,
-        SubscribeCallback& presenceHandler)
+        const std::string& host, const std::string& resourceType,
+        OCConnectivityType connectivityType, SubscribeCallback& presenceHandler)
 #else
     OCStackResult InProcClientWrapper::SubscribePresence(OCDoHandle* handle,
         const std::string& host, const std::string& resourceType,
index c240480..62bce98 100644 (file)
@@ -72,7 +72,8 @@ namespace OC
 
 #ifdef CA_INT
         OCResource::Ptr constructResourceObject(const std::string& host,
-                                                const std::string& uri, uint8_t connectivityType,
+                                                const std::string& uri,
+                                                OCConnectivityType connectivityType,
                                                 bool isObservable,
                                                 const std::vector<std::string>& resourceTypes,
                                                 const std::vector<std::string>& interfaces)
@@ -84,7 +85,7 @@ namespace OC
 
         OCStackResult findResource(const std::string& host,
                                                 const std::string& resourceName,
-                                                uint8_t connectivityType,
+                                                OCConnectivityType connectivityType,
                                                 FindCallback resourceHandler)
         {
             return OCPlatform_impl::Instance().findResource(host, resourceName,
@@ -93,7 +94,7 @@ namespace OC
 
         OCStackResult findResource(const std::string& host,
                                                 const std::string& resourceName,
-                                                uint8_t connectivityType,
+                                                OCConnectivityType connectivityType,
                                                 FindCallback resourceHandler, QualityOfService QoS)
         {
             return OCPlatform_impl::Instance().findResource(host, resourceName, connectivityType,
@@ -102,7 +103,7 @@ namespace OC
 
         OCStackResult getDeviceInfo(const std::string& host,
                                                 const std::string& deviceURI,
-                                                uint8_t connectivityType,
+                                                OCConnectivityType connectivityType,
                                                 FindDeviceCallback deviceInfoHandler)
         {
             return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI,
@@ -111,7 +112,7 @@ namespace OC
 
         OCStackResult getDeviceInfo(const std::string& host,
                                                 const std::string& deviceURI,
-                                                uint8_t connectivityType,
+                                                OCConnectivityType connectivityType,
                                                 FindDeviceCallback deviceInfoHandler,
                                                 QualityOfService QoS)
         {
@@ -127,7 +128,7 @@ namespace OC
 //TODO-CA Revisit this API
 #ifdef CA_INT
             return OCPlatform_impl::Instance().findResource(host, resourceName,
-                                                    OC_WIFI | OC_ETHERNET, resourceHandler);
+                                                    OC_WIFI, resourceHandler);
 #else
             return OCPlatform_impl::Instance().findResource(host, resourceName, resourceHandler);
 #endif
@@ -140,7 +141,7 @@ namespace OC
 //TODO-CA Revisit this API
 #ifdef CA_INT
             return OCPlatform_impl::Instance().findResource(host, resourceName,
-                                                OC_WIFI | OC_ETHERNET, resourceHandler, QoS);
+                                                OC_WIFI, resourceHandler, QoS);
 #else
             return OCPlatform_impl::Instance().findResource(host, resourceName,
                                                 resourceHandler, QoS);
@@ -155,8 +156,8 @@ namespace OC
         {
 //TODO-CA Revisit this API
 #ifdef CA_INT
-            return OCPlatform_impl::Instance().constructResourceObject(host, uri, isObservable,
-                                                OC_WIFI | OC_ETHERNET, resourceTypes, interfaces);
+            return OCPlatform_impl::Instance().constructResourceObject(host, uri, OC_WIFI,
+                                                isObservable, resourceTypes, interfaces);
 #else
             return OCPlatform_impl::Instance().constructResourceObject(host, uri, isObservable,
                                                 resourceTypes, interfaces);
@@ -168,7 +169,7 @@ namespace OC
                                                 FindDeviceCallback deviceInfoHandler)
         {
 #ifdef CA_INT
-            return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, OC_WIFI | OC_ETHERNET,
+            return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, OC_WIFI,
                                                             deviceInfoHandler);
 #else
             return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, deviceInfoHandler);
@@ -181,7 +182,7 @@ namespace OC
                                                 QualityOfService QoS)
         {
 #ifdef CA_INT
-            return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, OC_WIFI | OC_ETHERNET,
+            return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, OC_WIFI,
                                                             deviceInfoHandler, QoS);
 #else
             return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, deviceInfoHandler, QoS);
@@ -269,7 +270,7 @@ namespace OC
 #ifdef CA_INT
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle,
                                                 const std::string& host,
-                                                uint8_t connectivityType,
+                                                OCConnectivityType connectivityType,
                                                 SubscribeCallback presenceHandler)
         {
             return OCPlatform_impl::Instance().subscribePresence(presenceHandle, host,
@@ -279,7 +280,7 @@ namespace OC
         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle,
                                                 const std::string& host,
                                                 const std::string& resourceType,
-                                                uint8_t connectivityType,
+                                                OCConnectivityType connectivityType,
                                                 SubscribeCallback presenceHandler)
         {
             return OCPlatform_impl::Instance().subscribePresence(presenceHandle, host,
@@ -293,7 +294,7 @@ namespace OC
 //TODO-CA Revisit this API
 #ifdef CA_INT
             return OCPlatform_impl::Instance().subscribePresence(presenceHandle, host,
-                                                OC_WIFI | OC_ETHERNET, presenceHandler);
+                                                OC_WIFI, presenceHandler);
 #else
             return OCPlatform_impl::Instance().subscribePresence(presenceHandle, host,
                                                 presenceHandler);
@@ -308,7 +309,7 @@ namespace OC
 //TODO-CA Revisit this API
 #ifdef CA_INT
             return OCPlatform_impl::Instance().subscribePresence(presenceHandle, host,
-                                                resourceType, OC_WIFI | OC_ETHERNET,
+                                                resourceType, OC_WIFI,
                                                 presenceHandler);
 #else
             return OCPlatform_impl::Instance().subscribePresence(presenceHandle, host,
index 00ddad2..3039fe5 100644 (file)
@@ -140,7 +140,8 @@ namespace OC
 
 #ifdef CA_INT
     OCResource::Ptr OCPlatform_impl::constructResourceObject(const std::string& host,
-                                                const std::string& uri, uint8_t connectivityType,
+                                                const std::string& uri,
+                                                OCConnectivityType connectivityType,
                                                 bool isObservable,
                                                 const std::vector<std::string>& resourceTypes,
                                                 const std::vector<std::string>& interfaces)
@@ -160,7 +161,7 @@ namespace OC
 
     OCStackResult OCPlatform_impl::findResource(const std::string& host,
                                             const std::string& resourceName,
-                                            uint8_t connectivityType,
+                                            OCConnectivityType connectivityType,
                                             FindCallback resourceHandler)
     {
         return findResource(host, resourceName, connectivityType, resourceHandler, m_cfg.QoS);
@@ -168,7 +169,7 @@ namespace OC
 
     OCStackResult OCPlatform_impl::findResource(const std::string& host,
                                             const std::string& resourceName,
-                                            uint8_t connectivityType,
+                                            OCConnectivityType connectivityType,
                                             FindCallback resourceHandler, QualityOfService QoS)
     {
 
@@ -178,7 +179,7 @@ namespace OC
 
     OCStackResult OCPlatform_impl::getDeviceInfo(const std::string& host,
                                             const std::string& deviceURI,
-                                            uint8_t connectivityType,
+                                            OCConnectivityType connectivityType,
                                             FindDeviceCallback deviceInfoHandler)
     {
         return result_guard(getDeviceInfo(host, deviceURI, connectivityType,
@@ -187,7 +188,7 @@ namespace OC
 
     OCStackResult OCPlatform_impl::getDeviceInfo(const std::string& host,
                                             const std::string& deviceURI,
-                                            uint8_t connectivityType,
+                                            OCConnectivityType connectivityType,
                                             FindDeviceCallback deviceInfoHandler,
                                             QualityOfService QoS)
     {
@@ -356,7 +357,8 @@ namespace OC
 
 #ifdef CA_INT
     OCStackResult OCPlatform_impl::subscribePresence(OCPresenceHandle& presenceHandle,
-                                            const std::string& host, uint8_t connectivityType,
+                                            const std::string& host,
+                                            OCConnectivityType connectivityType,
                                             SubscribeCallback presenceHandler)
     {
         return subscribePresence(presenceHandle, host, "", connectivityType, presenceHandler);
@@ -366,7 +368,7 @@ namespace OC
     OCStackResult OCPlatform_impl::subscribePresence(OCPresenceHandle& presenceHandle,
                                             const std::string& host,
                                             const std::string& resourceType,
-                                            uint8_t connectivityType,
+                                            OCConnectivityType connectivityType,
                                             SubscribeCallback presenceHandler)
     {
         return checked_guard(m_client, &IClientWrapper::SubscribePresence,
index 847d21d..3a1312c 100644 (file)
@@ -32,7 +32,7 @@ using OC::checked_guard;
 #ifdef CA_INT
 OCResource::OCResource(std::weak_ptr<IClientWrapper> clientWrapper, const std::string& host,
                        const std::string& uri, const std::string& serverId,
-                       uint8_t connectivityType, bool observable,
+                       OCConnectivityType connectivityType, bool observable,
                        const std::vector<std::string>& resourceTypes,
                        const std::vector<std::string>& interfaces)
  :  m_clientWrapper(clientWrapper), m_uri(uri), m_resourceId(serverId, m_uri),
@@ -325,7 +325,7 @@ std::string OCResource::uri() const
 }
 
 #ifdef CA_INT
-uint8_t OCResource::connectivityType() const
+OCConnectivityType OCResource::connectivityType() const
 {
     return m_connectivityType;
 }