OCConnectivityType::CT_DEFAULT,
std::bind(&NSConsumerSimulator::findResultCallback, this, std::placeholders::_1),
OC::QualityOfService::LowQos);
OCConnectivityType::CT_DEFAULT,
std::bind(&NSConsumerSimulator::findResultCallback, this, std::placeholders::_1),
OC::QualityOfService::LowQos);
- rep.setValue("providerId", providerID);
- rep.setValue("messageId", id);
- rep.setValue("state", type);
+ rep.setValue("x.org.iotivity.ns.providerid", providerID);
+ rep.setValue("x.org.iotivity.ns.messageid", id);
+ rep.setValue("x.org.iotivity.ns.state", type);
m_syncResource->post(rep, OC::QueryParamsMap(), &onPost, OC::QualityOfService::LowQos);
}
m_syncResource->post(rep, OC::QueryParamsMap(), &onPost, OC::QualityOfService::LowQos);
}
OC::QueryParamsMap(), std::bind(&NSConsumerSimulator::onGet, this,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
resource), OC::QualityOfService::LowQos);
OC::QueryParamsMap(), std::bind(&NSConsumerSimulator::onGet, this,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
resource), OC::QualityOfService::LowQos);
const OC::OCRepresentation &rep , const int & /*eCode*/, const int &,
std::shared_ptr<OC::OCResource> )
{
const OC::OCRepresentation &rep , const int & /*eCode*/, const int &,
std::shared_ptr<OC::OCResource> )
{
- if (rep.getUri() == "/notification/message" && rep.hasAttribute("messageId")
- && rep.getValue<int>("messageId") != 1)
+ if (rep.getUri() == "/notification/message" && rep.hasAttribute("x.org.iotivity.ns.messageid")
+ && rep.getValue<int>("x.org.iotivity.ns.messageid") != 1)
- m_messageFunc(int(rep.getValue<int>("messageId")),
- std::string(rep.getValueToString("title")),
- std::string(rep.getValueToString("contentText")),
- std::string(rep.getValueToString("source")));
+ m_messageFunc(int(rep.getValue<int>("x.org.iotivity.ns.messageid")),
+ std::string(rep.getValueToString("x.org.iotivity.ns.title")),
+ std::string(rep.getValueToString("x.org.iotivity.ns.contenttext")),
+ std::string(rep.getValueToString("x.org.iotivity.ns.source")));
std::string("oic.if.baseline"), OC::QueryParamsMap(),
std::bind(&NSConsumerSimulator::onTopicGet, this, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3, m_topicResource),
std::string("oic.if.baseline"), OC::QueryParamsMap(),
std::bind(&NSConsumerSimulator::onTopicGet, this, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3, m_topicResource),
std::vector<OC::OCRepresentation> postTopicArr;
for(std::vector<OC::OCRepresentation>::iterator it = topicArr.begin();
std::vector<OC::OCRepresentation> postTopicArr;
for(std::vector<OC::OCRepresentation>::iterator it = topicArr.begin();
/* std::cout << *it; ... */
OC::OCRepresentation topic = *it;
OC::OCRepresentation postTopic;
/* std::cout << *it; ... */
OC::OCRepresentation topic = *it;
OC::OCRepresentation postTopic;
- postTopic.setValue("topicName", topic.getValueToString("topicName"));
- postTopic.setValue("topicState", (int) topic.getValue<int>("topicState"));
+ postTopic.setValue("x.org.iotivity.ns.topicname", topic.getValueToString("x.org.iotivity.ns.topicname"));
+ postTopic.setValue("x.org.iotivity.ns.topicstate", (int) topic.getValue<int>("x.org.iotivity.ns.topicstate"));
std::string("123456789012345678901234567890123456")));
m_topicResource->post(postRep, map, &onPost, OC::QualityOfService::LowQos);
}
std::string("123456789012345678901234567890123456")));
m_topicResource->post(postRep, map, &onPost, OC::QualityOfService::LowQos);
}