1 //******************************************************************
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 * This file contains the declaration of SceneUtils class and constant variables.
27 #ifndef SCENE_COMMONS_H
28 #define SCENE_COMMONS_H
34 #include "RCSRemoteResourceObject.h"
40 const std::string SCENE_LIST_DEFAULT_NAME = "list of scene Collections";
42 const std::string SCENE_KEY_LAST_SCENE = "lastScene";
43 const std::string SCENE_KEY_SCENEVALUES = "sceneValues";
44 const std::string SCENE_KEY_NAME = "n";
45 const std::string SCENE_KEY_ID = "id";
46 const std::string SCENE_KEY_RTS = "rts";
47 const std::string SCENE_KEY_RT = "rt";
48 const std::string SCENE_KEY_IF = "if";
49 const std::string SCENE_KEY_PAYLOAD_LINK = "link";
50 const std::string SCENE_KEY_SCENEMAPPINGS = "sceneMappings";
51 const std::string SCENE_KEY_HREF = "href";
52 const std::string SCENE_KEY_SCENE = "scene";
53 const std::string SCENE_KEY_MEMBERPROPERTY = "memberProperty";
54 const std::string SCENE_KEY_MEMBERVALUE = "memberValue";
55 const std::string SCENE_KEY_CREATEDLINK = "createdlink";
57 const std::string SCENE_KEY_URI = "uri";
58 const std::string SCENE_KEY_CHILD = "child";
60 const std::string SCENE_LIST_RT = "oic.wk.scenelist";
61 const std::string SCENE_MEMBER_RT = "oic.wk.scenemember";
62 const std::string SCENE_COLLECTION_RT = "oic.wk.scenecollection";
64 const std::string COAP_TAG = "coap://";
65 const std::string SCENE_LIST_URI = "/SceneListResURI";
66 const std::string PREFIX_SCENE_COLLECTION_URI = "/a/sceneCollection";
67 const std::string PREFIX_SCENE_MEMBER_URI = "/a/sceneMember";
69 const std::string LINK_BATCH = "oic.if.lb";
70 const std::string BASELINE_IF = "oic.if.baseline";
72 const OCConnectivityType SCENE_CONNECTIVITY = CT_ADAPTER_IP;
73 const std::string SCENE_CLIENT_REQ_IF = BASELINE_IF;
74 const std::string SCENE_CLIENT_CREATE_REQ_IF = OC::BATCH_INTERFACE;
76 const int SCENE_RESPONSE_SUCCESS = 200;
77 const int SCENE_CLIENT_BADREQUEST = 400;
78 const int SCENE_SERVER_INTERNALSERVERERROR = 500;
84 * Returns UUID for Scene collection resource and members ID.
88 static std::string OICGenerateUUIDStr();
91 * Returns host resource's address and uri from coap address.
93 * @param address uri of host resource (e.g. coap://192.168.0.2:12345/a/light)
94 * @param[out] host host resource's address (e.g. 192.168.0.2:12345)
95 * @param[out] uri host resource's uri (e.g. /a/light)
97 * @throw RCSInvalidParameterException
99 static void getHostUriString(
100 const std::string address, std::string *host, std::string *uri);
103 * Returns information of my own network address.
105 * This functionality use the CA interface for getting network information.
106 * But It has design issue. So, It will should change to other interface.
108 * @throw RCSException
110 static std::string getNetAddress();
113 * Returns RCSRemoteResourceObject pointer created with provided resource information.
115 * @param address uri of resource (e.g. coap://192.168.0.2:12345/a/light)
116 * @param ct OCConnectivityType type of connectivity indicating the interface
117 * @param vecRT a vector of resource types implemented by the resource
118 * @param vecIF a vector of interfaces that the resource supports/implements
120 * @throw RCSException
122 static RCSRemoteResourceObject::Ptr createRCSResourceObject(
123 const std::string &address, const OCConnectivityType ct,
124 const std::vector< std::string > &vecRT, const std::vector< std::string > &vecIF);
129 #endif // SCENE_COMMONS_H