1 //******************************************************************
3 // Copyright 2015 Intel Mobile Communications GmbH 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 IOTVT_SRM_PSTATR_H
22 #define IOTVT_SRM_PSTATR_H
29 * Initialize Pstat resource by loading data from persistent storage.
31 * @retval OC_STACK_OK for Success, otherwise some error value
33 OCStackResult InitPstatResource();
36 * Perform cleanup for Pstat resources.
38 * @retval OC_STACK_OK for Success, otherwise some error value
40 OCStackResult DeInitPstatResource();
43 * This method converts JSON PSTAT into binary PSTAT.
45 * @param[in] jsonStr pstat data in json string.
46 * @return pointer to OicSecPstat_t.
48 OicSecPstat_t * JSONToPstatBin(const char * jsonStr);
51 * This method converts pstat data into JSON format.
53 * @param[in] pstat pstat data in binary format.
54 * @return pointer to pstat json string.
56 char * BinToPstatJSON(const OicSecPstat_t * pstat);
58 /** This function deallocates the memory for OicSecPstat_t.
60 * @param[in] pstat Pointer to OicSecPstat_t.
62 void DeletePstatBinData(OicSecPstat_t* pstat);
65 * Function to restore pstat resurce to initial status.
66 * This function will use in case of error while ownership transfer
68 void RestorePstatToInitState();
74 #endif //IOTVT_SRM_PSTATR_H