+std::string OCResource::deviceName() const
+{
+ return m_deviceName;
+}
+
+OCDevAddr OCResource::getDevAddr() const
+{
+ return m_devAddr;
+}
+
+#ifdef WITH_MQ
+OCStackResult OCResource::discoveryMQTopics(const QueryParamsMap& queryParametersMap,
+ MQTopicCallback attributeHandler,
+ QualityOfService qos)
+{
+ return checked_guard(m_clientWrapper.lock(),
+ &IClientWrapper::ListenForMQTopic,
+ m_devAddr, m_uri,
+ queryParametersMap, m_headerOptions,
+ attributeHandler, qos);
+}
+
+OCStackResult OCResource::createMQTopic(const OCRepresentation& rep,
+ const std::string& topicUri,
+ const QueryParamsMap& queryParametersMap,
+ MQTopicCallback attributeHandler,
+ QualityOfService qos)
+{
+ return checked_guard(m_clientWrapper.lock(), &IClientWrapper::PutMQTopicRepresentation,
+ m_devAddr, topicUri, rep, queryParametersMap,
+ m_headerOptions, attributeHandler, qos);
+}
+#endif
+#ifdef MQ_SUBSCRIBER
+OCStackResult OCResource::subscribeMQTopic(ObserveType observeType,
+ const QueryParamsMap& queryParametersMap,
+ ObserveCallback observeHandler,
+ QualityOfService qos)
+{
+ return result_guard(observe(observeType, queryParametersMap, observeHandler, qos));
+}
+
+OCStackResult OCResource::unsubscribeMQTopic(QualityOfService qos)
+{
+ return result_guard(cancelObserve(qos));
+}
+
+OCStackResult OCResource::requestMQPublish(const QueryParamsMap& queryParametersMap,
+ PostCallback attributeHandler,
+ QualityOfService qos)
+{
+ OCRepresentation rep;
+ rep.setValue(std::string("req_pub"), std::string("true"));
+ return result_guard(post(rep, queryParametersMap, attributeHandler, qos));
+}
+#endif
+#ifdef MQ_PUBLISHER
+OCStackResult OCResource::publishMQTopic(const OCRepresentation& rep,
+ const QueryParamsMap& queryParametersMap,
+ PostCallback attributeHandler,
+ QualityOfService qos)
+{
+ return result_guard(post(rep, queryParametersMap, attributeHandler, qos));
+}
+#endif
+