"rt" property is written inside "rep" property.
Change-Id: I2cf76661d9c04b32587333a5aefb4474f863d3e7
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18991
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
for(auto child = children.begin(); child != children.end(); ++child)
{
- for(auto rt : child->getResourceTypes())
+ OCRepresentation rep;
+ if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
{
- if(0 == rt.compare(OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF))
+ rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
+ }
+ else
+ {
+ return false;
+ }
+
+ if(rep.hasAttribute(OC_RSRVD_RESOURCE_TYPE))
+ {
+ for (auto rt : rep.getValue<std::vector<std::string>>(OC_RSRVD_RESOURCE_TYPE))
{
- return true;
+ if(0 == rt.compare(OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF))
+ {
+ return true;
+ }
}
}
}