Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / nsframework / framework_unified / client / include / native_service / ns_np_service_nor_persistence.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 //////////////////////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_NPPService
19 /// \brief    This file contains the declaration for methods to retrieve and store data for NOR storage
20 ///
21 ///
22 ///
23 //////////////////////////////////////////////////////////////////////////////////////////////////
24
25 /**
26  * @file ns_np_service_nor_persistence.h
27  * @brief    This file contains the declaration for methods to retrieve and store data for NOR storage
28  */
29
30 /** @addtogroup BaseSystem
31  *  @{
32  */
33 /** @addtogroup native_service
34  *  @ingroup BaseSystem
35  *  @{
36  */
37 /** @addtogroup notification_persistent_service
38  *  @ingroup native_service
39  *  @{
40  */
41
42 #ifndef __NATIVESERVICES_NP_NOR_SERVICE_H__  // NOLINT  (build/header_guard)
43 #define __NATIVESERVICES_NP_NOR_SERVICE_H__
44
45 ///////////////////////////////////////////////////////////////////////////////
46 // Include Files
47 ///////////////////////////////////////////////////////////////////////////////
48 #include <native_service/frameworkunified_types.h>
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53
54   ////////////////////////////////////////////////////////////////////////////////////////////
55   /// \ingroup NPSynchronousReadPersistentData
56   /// \~english @par Brief
57   ///        API to synchronously read persistent data corresponding to a notification before NPPService is available
58   /// \~english @param[in] pAppName
59   ///        PCSTR - Application/ thread name
60   /// \~english @param[in] notif_name
61   //         PCSTR - Name of Notification
62   /// \~english @param[in] pData
63   ///        PVOID - Pointer to the buffer where read data will be written.
64   /// \~english @param[in] uiDataSize
65   ///        UI_32 - Length of the data buffer.
66   /// \~english @param[in] ePersistCategory
67   ///        const EFrameworkunifiedPersistCategory - Persist Category of Notification.
68   /// \~english @retval eFrameworkunifiedStatusOK
69   /// \~english @retval eFrameworkunifiedStatusInvldParam
70   /// \~english @retval eFrameworkunifiedStatusFail
71   /// \~english @par Preconditons
72   ///        none
73   /// \~english @par Change of internal status
74   ///       - Change of internal state according to the API does not occur.
75   /// \~english @par Conditions of processing failure
76   ///       - NULL handle specified in the argument(pAppName).[eFrameworkunifiedStatusInvldParam]
77   ///       - NULL handle specified in the argument(notif_name).[eFrameworkunifiedStatusInvldParam]
78   ///       - NULL handle specified in the argument(pData).[eFrameworkunifiedStatusInvldParam]
79   ///       - 0 specified in the argument(uiDataSize).[eFrameworkunifiedStatusFail]
80   ///       - Handle of the application [eFrameworkunifiedStatusFail]
81   ///       - If the file access process fails,.... [eFrameworkunifiedStatusFail]
82   /// \~english @par Detail
83   ///          API to synchronously read persistent data corresponding to a notification before NPPService is available
84   /// \~english @par
85   ///          File reading by this API is exclusive control by semaphore,
86   ///          and writing to non-voatie area is to use NPSynchronousWritePersistentData().
87   /// \~english @par Classification
88   ///          Public
89   /// \~english @par Type
90   ///          Set Get
91   /// \~english @see NPSynchronousWritePersistentData
92   ////////////////////////////////////////////////////////////////////////////////////////////
93 EFrameworkunifiedStatus NPSynchronousReadPersistentData(PCSTR pAppName,
94                                            PCSTR notif_name,
95                                            PVOID pData,
96                                            UI_32 uiDataSize,
97                                            const EFrameworkunifiedPersistCategory ePersistCategory = eFrameworkunifiedUserData);
98
99   ////////////////////////////////////////////////////////////////////////////////////////////
100   /// \ingroup NPSynchronousWritePersistentData
101   /// \~english @par Brief
102   ///        API to synchronously write persistent data corresponding to a notification before NPPService is available
103   /// \~english @param[in] pAppName
104   ///        PCSTR - Application/ thread name
105   /// \~english @param[in] notif_name
106   //         PCSTR - Name of Notification
107   /// \~english @param[in] pData
108   ///        PVOID - Pointer to the buffer where read data will be written.
109   /// \~english @param[in] uiDataSize
110   ///        UI_32 - Length of the data buffer.
111   /// \~english @param[in] ePersistCategory
112   ///        const EFrameworkunifiedPersistCategory - Persist Category of Notification.
113     /// \~english @retval eFrameworkunifiedStatusOK
114   /// \~english @retval eFrameworkunifiedStatusInvldParam
115   /// \~english @retval eFrameworkunifiedStatusFail
116   /// \~english @par Preconditons
117   ///        none
118   /// \~english @par Change of internal status
119   ///       - Change of internal state according to the API does not occur.
120   /// \~english @par Conditions of processing failure
121   ///       - NULL handle specified in the argument(pAppName).[eFrameworkunifiedStatusInvldParam]
122   ///       - NULL handle specified in the argument(notif_name).[eFrameworkunifiedStatusInvldParam]
123   ///       - NULL handle specified in the argument(pData).[eFrameworkunifiedStatusInvldParam]
124   ///       - 0 specified in the argument(uiDataSize).[eFrameworkunifiedStatusFail]
125   ///       - Handle of the application [eFrameworkunifiedStatusFail]
126   ///       - If the file access process fails,.... [eFrameworkunifiedStatusFail]
127   /// \~english @par Detail
128   ///          API to synchronously read persistent data corresponding to a notification before NPPService is available
129   /// \~english @par
130   ///        File reading by this API is exclusive control by semaphore,
131   ///        and writing to non-voatie area is to use NPSynchronousWritePersistentData().
132   /// \~english @par Classification
133   ///          Public
134   /// \~english @par Type
135   ///          Set Get
136   /// \~english @see NPSynchronousWritePersistentData
137   ////////////////////////////////////////////////////////////////////////////////////////////
138 EFrameworkunifiedStatus NPSynchronousWritePersistentData(PCSTR pAppName,
139                                             PCSTR notif_name,
140                                             PVOID pData,
141                                             const UI_32 uiDataSize,
142                                             const EFrameworkunifiedPersistCategory ePersistCategory = eFrameworkunifiedUserData);
143 #ifdef __cplusplus
144 }
145 #endif
146
147 #endif /* __NATIVESERVICES_NP_NOR_SERVICE_H__ */  // NOLINT  (build/header_guard)
148 /** @}*/  // end of notification_persistent_service
149 /** @}*/  // end of native_service
150 /** @}*/  // end of BaseSystem
151 // EOF