- add rt, if attributes to SceneListResource
Change-Id: I07017fbfb99755d182676e5a946fde505e121e66
Signed-off-by: ChaJiWon <jw_wonny.cha@samsung.com>
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13105
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
(cherry picked from commit
3b06e2bd1f6db4bae9189dc974632df4caa77239)
Reviewed-on: https://gerrit.iotivity.org/gerrit/13189
{
RCSRepresentation rcsRep;
+ RCSResourceObject::LockGuard lock{ resource, RCSResourceObject::AutoNotifyPolicy::NEVER };
+ rcsRep.setAttributes(resource.getAttributes());
+
for (const auto& bound : resource.getBoundResources())
{
rcsRep.addChild(toRepresentation(*bound));
const std::string scene_name = "Night mode";
const std::string relativetUri = OC_RSRVD_WELL_KNOWN_URI;
-const std::vector<std::string> resourceTypes{ "oic.wk.scenelist", "core.light", "core.fan" };
+const std::vector<std::string> resourceTypes{ "oic.wk.sceneList", "core.light", "core.fan" };
std::mutex g_mtx;
std::mutex g_discoverymtx;
std::cout << "\t\tResource Host : " << hostAddress << std::endl;
// if the found resource is a scene list resource
- if (std::find(vecRTs.begin(), vecRTs.end(), "oic.wk.scenelist") != vecRTs.end())
+ if (std::find(vecRTs.begin(), vecRTs.end(), "oic.wk.sceneList") != vecRTs.end())
g_foundListResource = foundResource;
// if the found resource is a light resource
const std::string SCENE_KEY_URI = "uri";
const std::string SCENE_KEY_CHILD = "child";
- const std::string SCENE_LIST_RT = "oic.wk.scenelist";
- const std::string SCENE_MEMBER_RT = "oic.wk.scenemember";
- const std::string SCENE_COLLECTION_RT = "oic.wk.scenecollection";
+ const std::string SCENE_LIST_RT = "oic.wk.sceneList";
+ const std::string SCENE_MEMBER_RT = "oic.wk.sceneMember";
+ const std::string SCENE_COLLECTION_RT = "oic.wk.sceneCollection";
const std::string COAP_TAG = "coap://";
const std::string SCENE_LIST_URI = "/SceneListResURI";
RCSGetResponse SceneListResource::SceneListRequestHandler::onGetRequest(
const RCSRequest & request, RCSResourceAttributes & /*attributes*/)
{
-
- if(request.getInterface() != OC::DEFAULT_INTERFACE)
+ if(request.getInterface() != OC::DEFAULT_INTERFACE &&
+ !request.getInterface().empty())
{
return RCSGetResponse::defaultAction();
}
retAttr[SCENE_KEY_CHILD] = childrenAttrs;
}
+ if (!retAttr.contains("if"))
+ {
+ std::vector<std::string> ifs = { BASELINE_IF, OC::BATCH_INTERFACE, LINK_BATCH };
+ retAttr["if"] = ifs;
+ }
+
+ if (!retAttr.contains("rt"))
+ {
+ std::vector<std::string> rt = { SCENE_LIST_RT };
+ retAttr["rt"] = rt;
+ }
+
return RCSGetResponse::create(retAttr);
}