summaryrefslogtreecommitdiffstats
path: root/nsframework/framework_unified/client/include/native_service/ns_np_service.h
blob: e2a2deb792f2121e904a4cf09dbfde551f16c316 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

//////////////////////////////////////////////////////////////////////////////////////////////////
/// \ingroup  tag_NPPService
/// \brief    Header for message structures for notification_persistent_service.
///
/// Declares the external APIs to Notification and Persistence Service.
///
//////////////////////////////////////////////////////////////////////////////////////////////////

/**
 * @file ns_np_service.h
 */

/** @addtogroup BaseSystem
 *  @{
 */
/** @addtogroup native_service
 *  @ingroup BaseSystem
 *  @{
 */
/** @addtogroup notification_persistent_service
 *  @ingroup native_service
 *  @{
 */

#ifndef __NATIVESERVICES_NP_SERVICE_H__  // NOLINT  (build/header_guard)
#define __NATIVESERVICES_NP_SERVICE_H__

#include <native_service/frameworkunified_types.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * \~english  A structure to register notification msg
 */
typedef struct _NC_register_notif_msg {
  CHAR  notificationName[MAX_STRING_SIZE_NOTIFICATION];  //!< \~english notification event name string
  UI_32 maxLength;                       //!< \~english Maximum possible length (bytes) of
                                          // the message data
  // UI_8  bIsPersistent;                     ///< Flag to indicate if data has to be persisted.
  EFrameworkunifiedNotificationType persType;           //!< \~english Specifies persitence for this notification
  UI_8  dummy[4];                          //!< \~english Packing to 32 bit boundary
} NC_register_notif_msg;

/**
 * \~english  A structure to register multiple notification msg
 */
typedef struct _NC_register_multiple_notif_msg {
  UI_32 numNotifications;                 //!< \~english This has to be UI_32 to avoid holes.
  NC_register_notif_msg notifierList[1];  //!< \~english variable number of structures
} NC_register_multiple_notif_msg;

/**
 * \~english  A structure to register immediate notification msg
 */
typedef struct _NC_register_immediate_notif_msg {
  CHAR  notificationName[MAX_STRING_SIZE_NOTIFICATION];  //!< \~english Notification Event Name string
  UI_32 maxLength;                       //!< \~english Maximum possible length (bytes) of
                                          // the message data
  EFrameworkunifiedNotificationType persType;           //!< \~english Specifies persitence for this notification
  UI_32 delay;              //!< \~english Delay time for persistence
  UI_8  dummy[4];                          //!< \~english Packing to 32 bit boundary
} NC_register_immediate_notif_msg;

/**
 * \~english  A structure to register multiple immediate notification msg
 */
typedef struct _NC_register_multiple_immediate_notif_msg {
  UI_32 numNotifications;                 //!< \~english This has to be UI_32 to avoid holes.
  NC_register_immediate_notif_msg notifierList[1];  //!< \~english variable number of structures
} NC_register_multiple_immediate_notif_msg;

/**
 * \~english  A structure to unregister notification msg
 */
typedef struct _NC_unregister_notif_msg {
  CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION];  //!< \~english Notification Event Name string
} NC_unregister_notif_msg, NC_subscribe_msg, NC_unsubscribe_frm_notif_msg, NC_get_pers_data_msg;

/**
 * \~english  A structure to unregister multiple notification msg
 */
typedef struct _NC_unregister_multiple_notif_msg {
  UI_32 numNotifications;                       //!< \~english notification event name num
  NC_unregister_notif_msg notificationList[1];  //!< \~english notification event name List
} NC_unregister_multiple_notif_msg;

/**
 * \~english  A structure to save pers data
 */
typedef struct _NC_savepersdata_ack {
  EFrameworkunifiedStatus eStatus;  //!< \~english eFrameworkunifiedStatusOK is (valid - data stored, anything else is
} NC_savepersdata_ack;

/**
 * \~english  A structure to subscribe multiple notification msg
 */
typedef struct _NC_subscribe_multiple_notif_msg {
  UI_32 numNotifications;                //!< \~english notification event name num
  NC_subscribe_msg notificationList[1];  //!< \~english notification event name List
} NC_subscribe_multiple_notif_msg;

/**
 * \~english  A structure to subscribe multiple notification msg
 */
typedef struct _NC_unsubscribe_multiple_notif_msg {
  UI_32 numNotifications;                            //!< \~english notification event name num
  NC_unsubscribe_frm_notif_msg notificationList[1];  //!< \~english notification event name List
} NC_unsubscribe_multiple_notif_msg;

/**
 * \~english  A structure to get pers data failed
 */
typedef struct __NC_get_persdata_failed_ack {
  CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION];      //!< \~english notification name
} NC_get_persdata_failed_ack;

/**
 * \~english  A structure to set personality
 */
typedef struct _NC_User {
  CHAR cUsername[MAX_PATH_LENGTH];       //!< \~english name of personality
} NC_User;

/**
 * \~english  A structure to register persistent file with the notification_persistent_service
 */
typedef struct _NC_RegisterPersistentFileMsg {
  CHAR cFileTag[MAX_STRING_SIZE_TAG];  //!< \~english Tag associated with the
                                       // file that would be persisted
  BOOL bIsUserFile;                    //!< \~english is user file
} NC_RegisterPersistentFileMsg;

/**
 * \~english  A structure to specify where to load the file associated with the Tag
 */
typedef struct _NC_LoadPersistedFileMsg {
  CHAR cFileTag[MAX_STRING_SIZE_TAG];  //!< \~english Tag associated with the file
  CHAR cFilePath[MAX_PATH_LENGTH];     //!< \~english path to which the file needs to retrieved
  CHAR cUsername[MAX_PATH_LENGTH];     //!< \~english Name of the user for user specific file.
} NC_LoadPersistedFileMsg;

/**
 * \~english  A structure to release persistent file
 */
typedef struct _NC_ReleasePersistentFileMsg {
  EFrameworkunifiedReleaseType eFrameworkunifiedReleaseType;             //!< \~english should the file be persisted
  CHAR cFilePath[MAX_PATH_LENGTH];             //!< \~english path from which the
                                               // file needs to be picked up to persist
  CHAR cFileTag[MAX_STRING_SIZE_NOTIFICATION];  //!< \~english Tag associated with the
                                                // file to be persisted
  CHAR cUsername[MAX_PATH_LENGTH];             //!< \~english Name of the user for user specific file.
} NC_ReleasePersistentFileMsg;

/**
 * \~english  A structure to register persistent folder with the notification_persistent_service
 */
typedef struct _NC_RegisterPersistentFolderMsg {
  CHAR cFolderTag[MAX_STRING_SIZE_TAG];  //!< \~english Tag associated with the
                                         // folder that would be persisted
  BOOL bIsUserFolder;                    //!< \~english Check if the folder is of user type
} NC_RegisterPersistentFolderMsg;

/**
 * \~english  A structure to specify where to load the folder associated with the Tag
 */
typedef struct _NC_LoadPersistedFolderMsg {
  CHAR cFolderTag[MAX_STRING_SIZE_TAG];  //!< \~english Tag associated with the folder
  CHAR cFolderPath[MAX_PATH_LENGTH];     //!< \~english path to which the folder needs to retrieved
  CHAR cUsername[MAX_PATH_LENGTH];       //!< \~english Name of the user for user specific folder.
} NC_LoadPersistedFolderMsg;

/**
 * \~english  A structure to Release Persistent Folder Msg
 */
typedef struct _NC_ReleasePersistentFolderMsg {
  EFrameworkunifiedReleaseType eFrameworkunifiedReleaseType;               //!< \~english should the file be persisted
  CHAR cFolderPath[MAX_PATH_LENGTH];             //!< \~english path from which the folder
                                                  // needs to be picked up to persist
  CHAR cFolderTag[MAX_STRING_SIZE_NOTIFICATION];  //!< \~english Tag associated with
                                                  // the folder to be persisted
  CHAR cUsername[MAX_PATH_LENGTH];               //!< \~english Name of the user for user
                                                 // specific folder.
} NC_ReleasePersistentFolderMsg;

/**
 * \~english  A structure to Load Persisted Ack
 */
typedef struct _NC_LoadPersistedAck {
  EFrameworkunifiedStatus eStatus;         //!< \~english ack the success/failure in
                              // retrieving the file/folder from persistence
  CHAR cTag[MAX_PATH_LENGTH];  //!< \~english tag of the file/folder for which acknowledge is made
} NC_LoadPersistedAck, NC_ReleasePersistedAck;

/**
 * \~english  A structure to Nor Persistent Data
 */
typedef struct _NC_NorPersistentData {
  CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION];  //!< \~english Notification Event Name string
  CHAR pPublisherName[MAX_NAME_SIZE_APP];               //!< \~english Publisher Event Name string
  UI_32 dataSize;                                       //!< \~english data size
  UI_32 uiDelay;                                        //!< \~english ui Delay
  UI_32 uiMaxSize;                                      //!< \~english ui Max Size
} NC_NorPersistentData;

/**
 * \~english  A structure to request for deleting data from persistent memory
 */
typedef struct _NC_ClearPersistedDataReq {
  EFrameworkunifiedClearPersistence ePersistenceData;  //!< \~english defines what
                                          // data to be deleted from persistent memory
} NC_ClearPersistedDataReq;

/**
 * \~english  A structure for receiving ack of data deleted from persistent memory
 */
typedef struct _NC_ClearPersisteDatadAck {
  EFrameworkunifiedStatus eStatus;  //!< \~english ack status of ClearPersistedData request
} NC_ClearPersisteDatadAck;

/**
 * \~english  A structure to request stop message to notification_persistent_service.
 */
typedef struct _NC_StopMsgData {
  EFrameworkunifiedShutdownType eShutdownType;  //!< \~english shutdown type
  UI_32 uiStopMsgData;  //!< \~english Reason for sending stop message to NPPService
} NC_StopMsgData;

/**
 * \~english  A structure to set the persist type of file and folder
 */
typedef struct _NC_SetPersistType {
  EFrameworkunifiedPersistCategory ePersistType;  //!< \~english persist type
  CHAR cTag[MAX_PATH_LENGTH];   //!< \~english tag name of the file or folder
} NC_SetFilePersistType, NC_SetFolderPersistType;

/**
 * \~english  A data received with ack sent by notification_persistent_service when immediate notification data is
 * written in persistent memory
 */
typedef struct _NC_ImmediateWriteAck {
  CHAR notificationName[MAX_STRING_SIZE_NOTIFICATION];  //!< \~english notification Name
  EFrameworkunifiedStatus eStatus;                                  //!< \~english status of request
} NC_ImmediateWriteAck;

#ifdef __cplusplus
}
#endif

#endif /* __NATIVESERVICES_NP_SERVICE_H__ */  // NOLINT  (build/header_guard)
/** @}*/  // end of notification_persistent_service
/** @}*/  // end of native_service
/** @}*/  // end of BaseSystem
// EOF