2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 //////////////////////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_NPServiceIf
19 /// \brief This file contains the declaration for internal functions to retrieve and store
20 /// immediate notification data from and to persistent storage.
24 //////////////////////////////////////////////////////////////////////////////////////////////////
26 #ifndef FRAMEWORK_UNIFIED_CLIENT_NS_NPSERVICEIF_INCLUDE_NS_NP_SERVICE_NOR_PERSISTENCE_INTERNAL_H_
27 #define FRAMEWORK_UNIFIED_CLIENT_NS_NPSERVICEIF_INCLUDE_NS_NP_SERVICE_NOR_PERSISTENCE_INTERNAL_H_
29 ///////////////////////////////////////////////////////////////////////////////
31 ///////////////////////////////////////////////////////////////////////////////
32 #include <native_service/frameworkunified_types.h>
33 #include <native_service/ns_np_service.h>
39 ////////////////////////////////////////////////////////////////////////////////////////////
40 /// NPSynchronousGetPersistentData
41 /// API to retrieve immediate storage notification data structure.
44 /// \param [in] pAppName
45 /// PCSTR - Name of application service
46 /// \param [in] notif_name
47 /// PCSTR - Name of notification to be written to immediate storage
49 /// PVOID - Notification data
50 /// \param [in] uiDataSize
51 /// UI_32 - Size of notification data
52 /// \param [out] ptNorPersistentData
53 /// NC_NorPersistentData - Immediate notification structure
54 /// \param [in] ePersistCategory
55 /// const EFrameworkunifiedPersistCategory - Persist Category of Notification.
58 /// EFrameworkunifiedStatus - success or error
59 ////////////////////////////////////////////////////////////////////////////////////////////
60 EFrameworkunifiedStatus NPSynchronousGetPersistentData(PCSTR pAppName,
64 NC_NorPersistentData &ptNorPersistentData,
65 const EFrameworkunifiedPersistCategory ePersistCategory);
67 ////////////////////////////////////////////////////////////////////////////////////////////
68 /// NPSynchronousGetPersistentDataSize
69 /// API to get immediate storage notification data size.
71 /// \param [in] notif_name
72 /// PCSTR - Name of notification to be read from immediate storage
73 /// \param [out] uiDataSize
74 /// PUI_32 - notification data size
75 /// \param [in] ePersistCategory
76 /// const EFrameworkunifiedPersistCategory - Persist Category of Notification.
78 /// \return EFrameworkunifiedStatus
79 /// EFrameworkunifiedStatus - success or failure
80 ////////////////////////////////////////////////////////////////////////////////////////////
81 EFrameworkunifiedStatus NPSynchronousGetPersistentDataSize(PCSTR notif_name,
83 const EFrameworkunifiedPersistCategory ePersistCategory);
85 ////////////////////////////////////////////////////////////////////////////////////////////
86 /// SynchronousGetPersistentDataSize
87 /// API to write immediate persistence notification data.
89 /// \param [in] notif_name
90 /// PCSTR - Name of notification to be read from immediate storage
91 /// \param [in] ePersistCategory
92 /// const EFrameworkunifiedPersistCategory - Persist Category of Notification.
95 /// UI_32 - size of the data
96 ////////////////////////////////////////////////////////////////////////////////////////////
97 EFrameworkunifiedStatus SynchronousWritePersistentData(PCSTR pAppName,
100 const UI_32 uiDataSize,
102 const UI_32 uiMaxSize,
103 const EFrameworkunifiedPersistCategory ePersistCategory);
105 ////////////////////////////////////////////////////////////////////////////////////////////
106 /// SynchronousMovePersistentData
107 /// API to move all the immediate notification data from f_cSrcDir directory to
108 /// f_cDestDir directory
110 /// \param [in] f_cSrcDir
111 /// PCSTR - Source directory full path
112 /// \param [in] f_cDestDir
113 /// PCSTR - Dest directory full path
115 /// \return EFrameworkunifiedStatus
116 /// EFrameworkunifiedStatus - eFrameworkunifiedStatusAccessError if source path not exists
117 /// eFrameworkunifiedStatusFileLoadError if unable to access src directory
118 /// eFrameworkunifiedStatusInvldParam if invalid parameter is received
119 /// eFrameworkunifiedStatusFail if error occurs while copying file
120 /// eFrameworkunifiedStatus on success
121 ////////////////////////////////////////////////////////////////////////////////////////////
122 EFrameworkunifiedStatus SynchronousMovePersistentData(PCSTR f_cSrcDir,
129 #endif // FRAMEWORK_UNIFIED_CLIENT_NS_NPSERVICEIF_INCLUDE_NS_NP_SERVICE_NOR_PERSISTENCE_INTERNAL_H_