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_NPPService
19 /// \brief Header for message structures for notification_persistent_service.
21 /// Declares the external APIs to Notification and Persistence Service.
23 //////////////////////////////////////////////////////////////////////////////////////////////////
26 * @file ns_np_service.h
29 /** @addtogroup BaseSystem
32 /** @addtogroup native_service
36 /** @addtogroup notification_persistent_service
37 * @ingroup native_service
41 #ifndef __NATIVESERVICES_NP_SERVICE_H__ // NOLINT (build/header_guard)
42 #define __NATIVESERVICES_NP_SERVICE_H__
44 #include <native_service/frameworkunified_types.h>
51 * \~english A structure to register notification msg
53 typedef struct _NC_register_notif_msg {
54 CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION]; //!< \~english notification event name string
55 UI_32 maxLength; //!< \~english Maximum possible length (bytes) of
57 // UI_8 bIsPersistent; ///< Flag to indicate if data has to be persisted.
58 EFrameworkunifiedNotificationType persType; //!< \~english Specifies persitence for this notification
59 UI_8 dummy[4]; //!< \~english Packing to 32 bit boundary
60 } NC_register_notif_msg;
63 * \~english A structure to register multiple notification msg
65 typedef struct _NC_register_multiple_notif_msg {
66 UI_32 numNotifications; //!< \~english This has to be UI_32 to avoid holes.
67 NC_register_notif_msg notifierList[1]; //!< \~english variable number of structures
68 } NC_register_multiple_notif_msg;
71 * \~english A structure to register immediate notification msg
73 typedef struct _NC_register_immediate_notif_msg {
74 CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION]; //!< \~english Notification Event Name string
75 UI_32 maxLength; //!< \~english Maximum possible length (bytes) of
77 EFrameworkunifiedNotificationType persType; //!< \~english Specifies persitence for this notification
78 UI_32 delay; //!< \~english Delay time for persistence
79 UI_8 dummy[4]; //!< \~english Packing to 32 bit boundary
80 } NC_register_immediate_notif_msg;
83 * \~english A structure to register multiple immediate notification msg
85 typedef struct _NC_register_multiple_immediate_notif_msg {
86 UI_32 numNotifications; //!< \~english This has to be UI_32 to avoid holes.
87 NC_register_immediate_notif_msg notifierList[1]; //!< \~english variable number of structures
88 } NC_register_multiple_immediate_notif_msg;
91 * \~english A structure to unregister notification msg
93 typedef struct _NC_unregister_notif_msg {
94 CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION]; //!< \~english Notification Event Name string
95 } NC_unregister_notif_msg, NC_subscribe_msg, NC_unsubscribe_frm_notif_msg, NC_get_pers_data_msg;
98 * \~english A structure to unregister multiple notification msg
100 typedef struct _NC_unregister_multiple_notif_msg {
101 UI_32 numNotifications; //!< \~english notification event name num
102 NC_unregister_notif_msg notificationList[1]; //!< \~english notification event name List
103 } NC_unregister_multiple_notif_msg;
106 * \~english A structure to save pers data
108 typedef struct _NC_savepersdata_ack {
109 EFrameworkunifiedStatus eStatus; //!< \~english eFrameworkunifiedStatusOK is (valid - data stored, anything else is
110 } NC_savepersdata_ack;
113 * \~english A structure to subscribe multiple notification msg
115 typedef struct _NC_subscribe_multiple_notif_msg {
116 UI_32 numNotifications; //!< \~english notification event name num
117 NC_subscribe_msg notificationList[1]; //!< \~english notification event name List
118 } NC_subscribe_multiple_notif_msg;
121 * \~english A structure to subscribe multiple notification msg
123 typedef struct _NC_unsubscribe_multiple_notif_msg {
124 UI_32 numNotifications; //!< \~english notification event name num
125 NC_unsubscribe_frm_notif_msg notificationList[1]; //!< \~english notification event name List
126 } NC_unsubscribe_multiple_notif_msg;
129 * \~english A structure to get pers data failed
131 typedef struct __NC_get_persdata_failed_ack {
132 CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION]; //!< \~english notification name
133 } NC_get_persdata_failed_ack;
136 * \~english A structure to set personality
138 typedef struct _NC_User {
139 CHAR cUsername[MAX_PATH_LENGTH]; //!< \~english name of personality
143 * \~english A structure to register persistent file with the notification_persistent_service
145 typedef struct _NC_RegisterPersistentFileMsg {
146 CHAR cFileTag[MAX_STRING_SIZE_TAG]; //!< \~english Tag associated with the
147 // file that would be persisted
148 BOOL bIsUserFile; //!< \~english is user file
149 } NC_RegisterPersistentFileMsg;
152 * \~english A structure to specify where to load the file associated with the Tag
154 typedef struct _NC_LoadPersistedFileMsg {
155 CHAR cFileTag[MAX_STRING_SIZE_TAG]; //!< \~english Tag associated with the file
156 CHAR cFilePath[MAX_PATH_LENGTH]; //!< \~english path to which the file needs to retrieved
157 CHAR cUsername[MAX_PATH_LENGTH]; //!< \~english Name of the user for user specific file.
158 } NC_LoadPersistedFileMsg;
161 * \~english A structure to release persistent file
163 typedef struct _NC_ReleasePersistentFileMsg {
164 EFrameworkunifiedReleaseType eFrameworkunifiedReleaseType; //!< \~english should the file be persisted
165 CHAR cFilePath[MAX_PATH_LENGTH]; //!< \~english path from which the
166 // file needs to be picked up to persist
167 CHAR cFileTag[MAX_STRING_SIZE_NOTIFICATION]; //!< \~english Tag associated with the
168 // file to be persisted
169 CHAR cUsername[MAX_PATH_LENGTH]; //!< \~english Name of the user for user specific file.
170 } NC_ReleasePersistentFileMsg;
173 * \~english A structure to register persistent folder with the notification_persistent_service
175 typedef struct _NC_RegisterPersistentFolderMsg {
176 CHAR cFolderTag[MAX_STRING_SIZE_TAG]; //!< \~english Tag associated with the
177 // folder that would be persisted
178 BOOL bIsUserFolder; //!< \~english Check if the folder is of user type
179 } NC_RegisterPersistentFolderMsg;
182 * \~english A structure to specify where to load the folder associated with the Tag
184 typedef struct _NC_LoadPersistedFolderMsg {
185 CHAR cFolderTag[MAX_STRING_SIZE_TAG]; //!< \~english Tag associated with the folder
186 CHAR cFolderPath[MAX_PATH_LENGTH]; //!< \~english path to which the folder needs to retrieved
187 CHAR cUsername[MAX_PATH_LENGTH]; //!< \~english Name of the user for user specific folder.
188 } NC_LoadPersistedFolderMsg;
191 * \~english A structure to Release Persistent Folder Msg
193 typedef struct _NC_ReleasePersistentFolderMsg {
194 EFrameworkunifiedReleaseType eFrameworkunifiedReleaseType; //!< \~english should the file be persisted
195 CHAR cFolderPath[MAX_PATH_LENGTH]; //!< \~english path from which the folder
196 // needs to be picked up to persist
197 CHAR cFolderTag[MAX_STRING_SIZE_NOTIFICATION]; //!< \~english Tag associated with
198 // the folder to be persisted
199 CHAR cUsername[MAX_PATH_LENGTH]; //!< \~english Name of the user for user
201 } NC_ReleasePersistentFolderMsg;
204 * \~english A structure to Load Persisted Ack
206 typedef struct _NC_LoadPersistedAck {
207 EFrameworkunifiedStatus eStatus; //!< \~english ack the success/failure in
208 // retrieving the file/folder from persistence
209 CHAR cTag[MAX_PATH_LENGTH]; //!< \~english tag of the file/folder for which acknowledge is made
210 } NC_LoadPersistedAck, NC_ReleasePersistedAck;
213 * \~english A structure to Nor Persistent Data
215 typedef struct _NC_NorPersistentData {
216 CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION]; //!< \~english Notification Event Name string
217 CHAR pPublisherName[MAX_NAME_SIZE_APP]; //!< \~english Publisher Event Name string
218 UI_32 dataSize; //!< \~english data size
219 UI_32 uiDelay; //!< \~english ui Delay
220 UI_32 uiMaxSize; //!< \~english ui Max Size
221 } NC_NorPersistentData;
224 * \~english A structure to request for deleting data from persistent memory
226 typedef struct _NC_ClearPersistedDataReq {
227 EFrameworkunifiedClearPersistence ePersistenceData; //!< \~english defines what
228 // data to be deleted from persistent memory
229 } NC_ClearPersistedDataReq;
232 * \~english A structure for receiving ack of data deleted from persistent memory
234 typedef struct _NC_ClearPersisteDatadAck {
235 EFrameworkunifiedStatus eStatus; //!< \~english ack status of ClearPersistedData request
236 } NC_ClearPersisteDatadAck;
239 * \~english A structure to request stop message to notification_persistent_service.
241 typedef struct _NC_StopMsgData {
242 EFrameworkunifiedShutdownType eShutdownType; //!< \~english shutdown type
243 UI_32 uiStopMsgData; //!< \~english Reason for sending stop message to NPPService
247 * \~english A structure to set the persist type of file and folder
249 typedef struct _NC_SetPersistType {
250 EFrameworkunifiedPersistCategory ePersistType; //!< \~english persist type
251 CHAR cTag[MAX_PATH_LENGTH]; //!< \~english tag name of the file or folder
252 } NC_SetFilePersistType, NC_SetFolderPersistType;
255 * \~english A data received with ack sent by notification_persistent_service when immediate notification data is
256 * written in persistent memory
258 typedef struct _NC_ImmediateWriteAck {
259 CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION]; //!< \~english notification Name
260 EFrameworkunifiedStatus eStatus; //!< \~english status of request
261 } NC_ImmediateWriteAck;
267 #endif /* __NATIVESERVICES_NP_SERVICE_H__ */ // NOLINT (build/header_guard)
268 /** @}*/ // end of notification_persistent_service
269 /** @}*/ // end of native_service
270 /** @}*/ // end of BaseSystem