RD client features in base layer
[platform/upstream/iotivity.git] / resource / csdk / stack / include / oicresourcedirectory.h
1 //******************************************************************
2 //
3 // Copyright 2016 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 OC_RESOURCE_DIRECTORY_H_
22 #define OC_RESOURCE_DIRECTORY_H_
23
24 #include "octypes.h"
25 #include "logger.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif // __cplusplus
30
31 #ifdef RD_CLIENT
32 /**
33  * Publish RD resource to Resource Directory.
34  *
35  * @param host The address of the RD.
36  * @param connectivityType Type of connectivity indicating the interface.
37  * @param resourceHandles This is the resource handle which we need to register to RD.
38  * @param nHandles The counts of resource handle.
39  * @param cbData Asynchronous callback function that is invoked by the stack when
40  *               response is received. The callback is generated for each response
41  *               received.
42  * @param qos Quality of service.
43  *
44  * @return ::OC_STACK_OK on success, some other value upon failure.
45  */
46 OC_EXPORT OCStackResult OCRDPublish(const char *host, OCConnectivityType connectivityType,
47                                     OCResourceHandle resourceHandles[], uint8_t nHandles,
48                                     OCCallbackData *cbData, OCQualityOfService qos);
49
50 /**
51  * Delete RD resource from Resource Directory.
52  *
53  * @param host The address of the RD.
54  * @param connectivityType Type of connectivity indicating the interface.
55  * @param resourceHandles This is the resource handle which we need to delete to RD.
56  * @param nHandles The counts of resource handle.
57  * @param cbData Asynchronous callback function that is invoked by the stack when
58  *               response is received. The callback is generated for each response
59  *               received.
60  * @param qos Quality of service.
61  *
62  * @return ::OC_STACK_OK on success, some other value upon failure.
63  */
64 OC_EXPORT OCStackResult OCRDDelete(const char *host, OCConnectivityType connectivityType,
65                                    OCResourceHandle resourceHandles[], uint8_t nHandles,
66                                    OCCallbackData *cbData, OCQualityOfService qos);
67 #endif
68 #ifdef __cplusplus
69 }
70 #endif // __cplusplus
71
72 #endif /* OC_RESOURCE_DIRECTORY_H_ */