X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Finclude%2FOCResource.h;h=e1f7bc6f1c884d5531c5ae57e2a522651984e212;hb=3c093548382bb2542c87a67e6e5fa32552c29cb3;hp=2167ba61b0dea11f81ef9759dbbc3b8dcbb33c4a;hpb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/include/OCResource.h b/resource/include/OCResource.h index 2167ba6..e1f7bc6 100644 --- a/resource/include/OCResource.h +++ b/resource/include/OCResource.h @@ -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 m_clientWrapper; std::string m_uri; OCResourceIdentifier m_resourceId; @@ -668,6 +700,7 @@ namespace OC std::vector m_interfaces; std::vector 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& resourceTypes, - const std::vector& interfaces); + const std::vector& interfaces, + const std::string& deviceName); OCResource(std::weak_ptr clientWrapper, const std::string& host, const std::string& uri, const std::string& serverId, OCConnectivityType connectivityType, uint8_t property, const std::vector& resourceTypes, - const std::vector& interfaces); + const std::vector& interfaces, + const std::string& deviceName); }; } // namespace OC