Imported Upstream version 1.2.0
[platform/upstream/iotivity.git] / resource / csdk / resource-directory / include / rd_server.h
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
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
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
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.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 #ifndef _RESOURCE_DIRECTORY_SERVER_H_
22 #define _RESOURCE_DIRECTORY_SERVER_H_
23
24 // Iotivity Base CAPI
25 #include "ocstack.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif // __cplusplus
30
31 /**
32 * This function creates resource /oic/rd.
33 *
34 * @return ::OC_STACK_OK upon success, ::OC_STACK_ERROR in case of error.
35 */
36 OCStackResult OCRDStart();
37
38 /**
39 * Stops resource directory.
40 * This function will stop the resource directory and removes all published
41 * resources information.
42 *
43 * @return ::OC_STACK_OK upon success, ::OC_STACK_ERROR is returned except
44 * the case that OC_STACK_SUCCESS is returned.
45 */
46 OCStackResult OCRDStop();
47
48 /**
49  * Checks based on the resource type if the entity exists in the resource directory.
50  *
51  * @param interfaceType a interface type that is being queried.
52  * @param resourceType a resource type that is being queried.
53  * @param payload A payload of the matching resource type or interface type or NULL.
54  *
55  * @return ::OC_STACK_OK upon success, ::OC_STACK_ERROR is returned except
56  * the case that OC_STACK_SUCCESS is returned.
57  */
58 OCStackResult OCRDCheckPublishedResource(const char *interfaceType, const char *resourceType,
59         OCDiscoveryPayload **payload);
60
61 #ifdef __cplusplus
62 }
63 #endif // __cplusplus
64
65 #endif //_RESOURCE_DIRECTORY_H_