replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / include / OCResource.h
index 2167ba6..e1f7bc6 100644 (file)
@@ -117,6 +117,7 @@ namespace OC
             m_uri(std::move(o.m_uri)),
             m_resourceId(std::move(o.m_resourceId)),
             m_devAddr(std::move(o.m_devAddr)),
+            m_deviceName(std::move(o.m_deviceName)),
             m_useHostString(o.m_useHostString),
             m_property(o.m_property),
             m_isCollection(o.m_isCollection),
@@ -485,6 +486,29 @@ namespace OC
         std::string host() const;
 
         /**
+        * Function to set host address information.
+        *
+        * @param host std::string host address
+        *             optionally one of
+        *                   CoAP over UDP prefix    "coap://"
+        *                   CoAP over TCP prefix    "coap+tcp://"
+        *                   CoAP over DTLS prefix   "coaps://"
+        *                   CoAP over TLS prefix    "coaps+tcp://"
+        *                   CoAP over RFCOMM prefix "coap+rfcomm://"
+        *                   CoAP over GATT prefix   "coap+gatt://"
+        *             optionally one of
+        *                   IPv6 address            "[1234::5678]"
+        *                   IPv4 address            "192.168.1.1"
+        *             optional port               ":5683"
+        *
+        * @note This should be in the format coap://address:port.
+        *       If host has different connectivity type with a given OCResource object
+        *       which was discovered after calling findResource API, raise an exception on failure.
+        *
+        */
+        void setHost(const std::string& host);
+
+        /**
         * Function to get the URI for this resource
         * @return std::string resource URI
         */
@@ -502,6 +526,8 @@ namespace OC
         *         not observable.
         */
         bool isObservable() const;
+        
+        OCDevAddr getDevAddr() const;
 
 #ifdef WITH_MQ
         /**
@@ -543,6 +569,13 @@ namespace OC
         */
         std::string sid() const;
 
+        /**
+        * Function to get a string representation of the human friendly name defined by the vendor.
+        * @note The format of the return value is subject to change and will
+        * likely change both in size and contents in the future.
+        */
+        std::string deviceName() const;
+
 #ifdef WITH_MQ
         /**
         * Function to discovery Topics from MQ Broker.
@@ -656,7 +689,6 @@ namespace OC
         bool operator>=(const OCResource &other) const;
 
     private:
-        void setHost(const std::string& host);
         std::weak_ptr<IClientWrapper> m_clientWrapper;
         std::string m_uri;
         OCResourceIdentifier m_resourceId;
@@ -668,6 +700,7 @@ namespace OC
         std::vector<std::string> m_interfaces;
         std::vector<std::string> m_children;
         OCDoHandle m_observeHandle;
+        std::string m_deviceName;
         HeaderOptions m_headerOptions;
 
     private:
@@ -675,14 +708,16 @@ namespace OC
                     const OCDevAddr& devAddr, const std::string& uri,
                     const std::string& serverId, uint8_t property,
                     const std::vector<std::string>& resourceTypes,
-                    const std::vector<std::string>& interfaces);
+                    const std::vector<std::string>& interfaces,
+                    const std::string& deviceName);
 
         OCResource(std::weak_ptr<IClientWrapper> clientWrapper,
                     const std::string& host, const std::string& uri,
                     const std::string& serverId,
                     OCConnectivityType connectivityType, uint8_t property,
                     const std::vector<std::string>& resourceTypes,
-                    const std::vector<std::string>& interfaces);
+                    const std::vector<std::string>& interfaces,
+                    const std::string& deviceName);
     };
 
 } // namespace OC