+
+ if(!isTopicPost)
+ {
+ isTopicPost = true;
+ OC::OCRepresentation postRep;
+
+ std::vector<OC::OCRepresentation> topicArr =
+ rep.getValue<std::vector<OC::OCRepresentation>>("topicList");
+
+ std::vector<OC::OCRepresentation> postTopicArr;
+
+ for(std::vector<OC::OCRepresentation>::iterator it = topicArr.begin();
+ it != topicArr.end(); ++it) {
+ /* std::cout << *it; ... */
+ OC::OCRepresentation topic = *it;
+ OC::OCRepresentation postTopic;
+
+ postTopic.setValue("topicName", topic.getValueToString("topicName"));
+ postTopic.setValue("topicState", (int) topic.getValue<int>("topicState"));
+
+ postTopicArr.push_back(topic);
+
+// std::cout << "tName : " << tName << std::endl;
+// std::cout << "tState : " << tState << std::endl;
+ }
+
+ postRep.setValue<std::vector<OC::OCRepresentation>>
+ ("topicList", postTopicArr);
+
+ OC::QueryParamsMap map;
+ map.insert(std::pair<std::string,std::string>(std::string("consumerId"),
+ std::string("123456789012345678901234567890123456")));
+ m_topicResource->post(postRep, map, &onPost, OC::QualityOfService::LowQos);
+ }