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 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef OC_RESOURCE_DIRECTORY_DATABASE_H_
22 #define OC_RESOURCE_DIRECTORY_DATABASE_H_
31 * Opens the RD publish database.
33 * @return ::OC_STACK_OK in case of success or else other value.
35 OCStackResult OCRDDatabaseInit();
38 * Stores in database the published resource.
40 * @param payload is the the published resource payload.
41 * @param address provide information about endpoint connectivity details.
43 * @return ::OC_STACK_OK in case of success or else other value.
45 OCStackResult OCRDDatabaseStoreResources(const OCRepPayload *payload, const OCDevAddr *address);
48 * Delete the RD resources
50 * @param deviceId of the device containing the resource(s) to be deleted.
51 * @param instanceIds the resource(s) to be deleted. If NULL then all resources
52 * belonging to the device will be deleted.
53 * @param nInstanceIds the number of instanceIds
55 * @return ::OC_STACK_OK in case of success or else other value.
57 OCStackResult OCRDDatabaseDeleteResources(const char *deviceId, const uint8_t *instanceIds,
58 uint8_t nInstanceIds);
61 * Close the RD publish database.
63 * @return ::OC_STACK_OK in case of success or else other value.
65 OCStackResult OCRDDatabaseClose();