Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / resource / csdk / security / include / internal / pstatresource.h
1 //******************************************************************
2 //
3 // Copyright 2015 Intel Mobile Communications GmbH 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 IOTVT_SRM_PSTATR_H
22 #define IOTVT_SRM_PSTATR_H
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29  * Initialize Pstat resource by loading data from persistent storage.
30  *
31  * @retval  OC_STACK_OK for Success, otherwise some error value
32  */
33 OCStackResult InitPstatResource();
34
35 /**
36  * Perform cleanup for Pstat resources.
37  *
38  * @retval  OC_STACK_OK for Success, otherwise some error value
39  */
40 OCStackResult DeInitPstatResource();
41
42 /**
43  * This method converts JSON PSTAT into binary PSTAT.
44  *
45  * @param[in] jsonStr  pstat data in json string.
46  * @return pointer to OicSecPstat_t.
47  */
48 OicSecPstat_t * JSONToPstatBin(const char * jsonStr);
49
50 /**
51  * This method converts pstat data into JSON format.
52  *
53  * @param[in] pstat  pstat data in binary format.
54  * @return pointer to pstat json string.
55  */
56 char * BinToPstatJSON(const OicSecPstat_t * pstat);
57
58 /** This function deallocates the memory for OicSecPstat_t.
59  *
60  * @param[in] pstat  Pointer to OicSecPstat_t.
61  */
62 void DeletePstatBinData(OicSecPstat_t* pstat);
63
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69 #endif //IOTVT_SRM_PSTATR_H
70
71