summaryrefslogtreecommitdiffstats
path: root/nsframework/backup_manager/client/include/native_service/ns_backup.h
blob: 5655ae350c78a34da6e4f224301b6cafe2cc2d29 (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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
/*
 * @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.
 */
/**
 * @file ns_backup.h
 * @brief backup_manager function header file
 */

#ifndef BACKUP_MANAGER_CLIENT_INCLUDE_NATIVE_SERVICE_NS_BACKUP_H_
#define BACKUP_MANAGER_CLIENT_INCLUDE_NATIVE_SERVICE_NS_BACKUP_H_

#include <native_service/frameworkunified_types.h>

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

/**
 * \~english  Service availability notify
 */
#define NTFY_BackupMgr_Availability "NS_BackupMgr/Availability"

/**
 * \~english  Return value: terminated normally
 */
#define BKUP_RET_NORMAL      0

/**
 * \~english  Return value: abnormal termination(content not specified)
 */
#define BKUP_RET_ERROR      -1

/**
 * \~english  Return value: parameter error
 */
#define BKUP_RET_ERRPARAM   -2

/**
 * \~english  Return value: initializing
 */
#define BKUP_RET_ERRINIT    -3

/**
 * \~english  Return value: terminating
 */
#define BKUP_RET_ERRTERM    -4

/**
 * \~english  Return value: data does not exist
 */
#define BKUP_RET_ERRNOENT   -5

/**
 * \~english  Return value: data size error
 */
#define BKUP_RET_ERRSIZE    -6


#ifdef __cplusplus
extern  "C" {
#endif

/**
 * \ingroup Backup_DataRd
 * \~english @par Brief
 *        Read data from backup area
 * \~english @param [in] tagID
 *        PCSTR   - Area ID(character string of less than 64 bytes)
 * \~english @param [in] uiOffset
 *        uint32_t    - Offset from the beginning of the area(0~size of backup area identified by area ID)
 * \~english @param [out] pvBuf
 *        void *    - A pointer which point to buffer used to storage read data
 * \~english @param [in] uiSize
 *        uint32_t     - Read data size(0~size of backup area identified by area ID)
 * \~english @retval BKUP_RET_NORMAL     Terminated normally
 * \~english @retval BKUP_RET_ERRPARAM   Parameter error(Sync message transmission or reception(@ref McInvokeSync) error[eFrameworkunifiedStatusInvldParam])
 * \~english @retval BKUP_RET_ERRINIT    Initializing(Sync message send or receive(@ref McInvokeSync) error [eFrameworkunifiedStatusErrOther])
 * \~english @retval BKUP_RET_ERRTERM    Terminating(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusExit])
 * \~english @retval BKUP_RET_ERRNOENT   Data dose not exist(Sync message transmission or reception(@ref McInvokeSync) fails [eFrameworkunifiedStatusFileLoadError])
 * \~english @retval BKUP_RET_ERRSIZE    Data size error(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusAccessError])
 * \~english @retval BKUP_RET_ERROR      Abnormal termination(@ref McOpenSender failed, or sync message transmission or reception(@ref McInvokeSync) error other than the above)
 * \~english @par Prerequisite
 *        - None.
 * \~english @par Change of internal state
 *        - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *        - If the area ID(tagID) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If the area ID(tagID) specified by the argument is 64 bytes or more than 64 bytes [BKUP_RET_ERRPARAM]
 *        - If the buffer point(pvBuf) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If system call(pctrl(PR_GET_NAME)) is error [BKUP_RET_ERROR]
 *        - If failed to open the message queue for transmission [BKUP_RET_ERROR]
 *        - If failed to genarate message queue name for synchronous communication [BKUP_RET_ERROR]
 *        - If failed to open the reception message queue for synchronous communication [BKUP_RET_ERROR]
 *        - Sync message transmission or reception(@ref McInvokeSync) error
 *          - If the return value is eFrameworkunifiedStatusInvldParam [BKUP_RET_ERRPARAM]
 *          - If the return value is eFrameworkunifiedStatusErrOther [BKUP_RET_ERRINIT]
 *          - If the return value is eFrameworkunifiedStatusExit [BKUP_RET_ERRTERM]
 *          - If the return value is eFrameworkunifiedStatusFileLoadError [BKUP_RET_ERRNOENT]
 *          - If the return value is eFrameworkunifiedStatusAccessError [BKUP_RET_ERRSIZE]
 *          - If the return value is eFrameworkunifiedStatusFail, it call will synchronization message transmission(@ref McInvokeSync) again after 100 milliseconds later
 *            If the return value is eFrameworkunifiedStatusFail, it will retry BKUP_RETRY_MAX(10) times
 *          - If the return value is other value [BKUP_RET_ERROR]
 *        - If the size specified by the argument does not match the actual read size [BKUP_RET_ERROR]
 * \~english @par Detail
          Judge the type and access destination according to specified area ID and then read data.
 *        - If appointed size is less than registered size, read data of appointed size. [BKUP_RET_NORMAL]
 *        - If the backup data does not exist, buffer is filled 0. [BKUP_RET_NORMAL]
 *
 * \~english @par Classification
 *        Public
 * \~english @par Type
 *        Sync
 * \~english @see
 *        Backup_DataWt
 */
int32_t Backup_DataRd(PCSTR tag_id, uint32_t ui_offset, void *pv_buf, uint32_t ui_size);
/**
 * \ingroup Backup_DataWt
 * \~english @par Brief
 *        Write data to backup area
 * \~english @param [in] tagID
 *        PCSTR   - Area ID(character string of less than 64 bytes)
 * \~english @param [in] pvBuf
 *        void *  - A pointer which point to buffer used to storage write data
 * \~english @param [in] uiOffset
 *        uint32_t    - Offset from the beginning of the area(0~size of backup area identified by area ID)
 * \~english @param [in] uiSize
 *        uint32_t     - Write data size(0~size of backup area identified by area ID)
 * \~english @retval BKUP_RET_NORMAL    Terminated normally
 * \~english @retval BKUP_RET_ERRPARAM  Parameter error(Sync message transmission or reception(@ref McInvokeSync) error[eFrameworkunifiedStatusInvldParam])
 * \~english @retval BKUP_RET_ERRINIT   Initializing(Sync message send or receive(@ref McInvokeSync) error [eFrameworkunifiedStatusErrOther])
 * \~english @retval BKUP_RET_ERRTERM   Terminating(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusExit])
 * \~english @retval BKUP_RET_ERRNOENT  Data dose not exist(Sync message transmission or reception(@ref McInvokeSync) fails [eFrameworkunifiedStatusFileLoadError])
 * \~english @retval BKUP_RET_ERRSIZE   Data size error(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusAccessError])
 * \~english @retval BKUP_RET_ERROR     Abnormal termination(@ref McOpenSender failed, or sync message transmission or reception(@ref McInvokeSync) error other than the above)
 * \~english @par Prerequisite
 *        - None.
 * \~english @par Change of internal state
 *        - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *        - If the area ID(tagID) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If the area ID(tagID) specified by the argument is 64 bytes or more than 64 bytes [BKUP_RET_ERRPARAM]
 *        - If the buffer point(pvBuf) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If system call(mmap()) is error [BKUP_RET_ERROR]
 *        - If system call(pctrl(PR_GET_NAME)) is error [BKUP_RET_ERROR]
 *        - If failed to open the message queue for transmission [BKUP_RET_ERROR]
 *        - If failed to genarate message queue name for synchronous communication [BKUP_RET_ERROR]
 *        - If failed to open the reception message queue for synchronous communication [BKUP_RET_ERROR]
 *        - Sync message transmission or reception(@ref McInvokeSync) error
 *          - If the return value is eFrameworkunifiedStatusInvldParam [BKUP_RET_ERRPARAM]
 *          - If the return value is eFrameworkunifiedStatusErrOther [BKUP_RET_ERRINIT]
 *          - If the return value is eFrameworkunifiedStatusExit [BKUP_RET_ERRTERM]
 *          - If the return value is eFrameworkunifiedStatusFileLoadError [BKUP_RET_ERRNOENT]
 *          - If the return value is eFrameworkunifiedStatusAccessError [BKUP_RET_ERRSIZE]
 *          - If the return value is eFrameworkunifiedStatusFail, it call will synchronization message transmission(@ref McInvokeSync) again after 100 milliseconds later
 *            If the return value is eFrameworkunifiedStatusFail, it will retry BKUP_RETRY_MAX(10) times
 *          - If the return value is other value [BKUP_RET_ERROR]
 *        - If the size specified by the argument does not match the actual read size [BKUP_RET_ERROR]
 * \~english @par Detail
 *        Judge the storage media type and access destination according to specified area ID and then write data.
 *        Calling @ref Backup_DataWt more than once for the same ID when writing data separately.
 *        Data integrity can not be guaranteed at power interruption.
 *        Data should be written at one time to guarantee data consistency.
 *        The work life of writing times depends on how the user writes,NS_BackupMgr doesn't guaranteed.
 * \~english @par Classification
 *        Public
 * \~english @par Type
 *        Sync
 * \~english @see
 *        Backup_DataRd
 */
int32_t Backup_DataWt(PCSTR tag_id, void *pv_buf, uint32_t ui_offset, uint32_t ui_size);


/**
 * \ingroup Backup_DataFil
 * \~english @par Brief
 *        Write data to backup area with the specified pattern
 * \~english @param [in] tagID
 *        PCSTR   - Area ID(character string of less than 64 bytes)
 * \~english @param [in] uiOffset
 *        uint32_t    - Offset from the beginning of the area(0~size of backup area identified by area ID)
 * \~english @param [in] ucPat
 *        uint8_t    - Write pattern data(0x00~0xff)
 * \~english @param [in] uiSize
 *        uint32_t     -  Write data size(0~size of backup area identified by area ID)
 * \~english @retval BKUP_RET_NORMAL     Terminated normally
 * \~english @retval BKUP_RET_ERRPARAM   Parameter error(Sync message transmission or reception(@ref McInvokeSync) error[eFrameworkunifiedStatusInvldParam])
 * \~english @retval BKUP_RET_ERRINIT    Initializing(Sync message send or receive(@ref McInvokeSync) error [eFrameworkunifiedStatusErrOther])
 * \~english @retval BKUP_RET_ERRTERM    Terminating(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusExit])
 * \~english @retval BKUP_RET_ERRNOENT   Data dose not exist(Sync message transmission or reception(@ref McInvokeSync) fails [eFrameworkunifiedStatusFileLoadError])
 * \~english @retval BKUP_RET_ERRSIZE    Data size error(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusAccessError])
 * \~english @retval BKUP_RET_ERROR      Abnormal termination(@ref McOpenSender failed, or sync message transmission or reception(@ref McInvokeSync) error other than the above)
 * \~english @par Prerequisite
 *        - None.
 * \~english @par Change of internal state
 *        - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *        - If the area ID(tagID) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If the area ID(tagID) specified by the argument is 64 bytes or more than 64 bytes [BKUP_RET_ERRPARAM]
 *        - If system call(pctrl(PR_GET_NAME)) is error [BKUP_RET_ERROR]
 *        - If failed to open the message queue for transmission [BKUP_RET_ERROR]
 *        - If failed to genarate message queue name for synchronous communication [BKUP_RET_ERROR]
 *        - If failed to open the reception message queue for synchronous communication [BKUP_RET_ERROR]
 *        - Sync message transmission or reception(@ref McInvokeSync) error
 *          - If the return value is eFrameworkunifiedStatusInvldParam [BKUP_RET_ERRPARAM]
 *          - If the return value is eFrameworkunifiedStatusErrOther [BKUP_RET_ERRINIT]
 *          - If the return value is eFrameworkunifiedStatusExit [BKUP_RET_ERRTERM]
 *          - If the return value is eFrameworkunifiedStatusFileLoadError [BKUP_RET_ERRNOENT]
 *          - If the return value is eFrameworkunifiedStatusAccessError [BKUP_RET_ERRSIZE]
 *          - If the return value is eFrameworkunifiedStatusFail, it call will synchronization message transmission(@ref McInvokeSync) again after 100 milliseconds later
 *            If the return value is eFrameworkunifiedStatusFail, it will retry BKUP_RETRY_MAX(10) times
 *          - If the return value is other value [BKUP_RET_ERROR]
 *        - If the size specified by the argument does not match the actual read size [BKUP_RET_ERROR]
 * \~english @par Detail
 *        Judge the type and access destination according to specified area ID and then fill it with the specified pattern.
 *        The work life of writing times depends on how the usrs writes,NS_BackupMgr doesn't guaranteed.
 * \~english @par Classification
 *        Public
 * \~english @par Type
 *        Sync
 * \~english @see
 *        none
 */
int32_t Backup_DataFil(PCSTR tag_id, uint32_t ui_offset, uint8_t uc_pat, uint32_t ui_size);


/**
 * \ingroup Backup_DataSz
 * \~english @par Brief
 *        Get the size of the backup area.
 * \~english @param [in] tagID
 *        PCSTR   - Area ID(character string of less than 64 bytes)
 * \~english @param [out] puiSize
 *        uint32_t *   -  A pointer which point to storage size
 * \~english @retval BKUP_RET_NORMAL     Terminated normally
 * \~english @retval BKUP_RET_ERRPARAM   Parameter error(Sync message transmission or reception(@ref McInvokeSync) error[eFrameworkunifiedStatusInvldParam])
 * \~english @retval BKUP_RET_ERRINIT    Initializing(Sync message send or receive(@ref McInvokeSync) error [eFrameworkunifiedStatusErrOther])
 * \~english @retval BKUP_RET_ERRTERM    Terminating(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusExit])
 * \~english @retval BKUP_RET_ERRNOENT   Data dose not exist(Sync message transmission or reception(@ref McInvokeSync) fails [eFrameworkunifiedStatusFileLoadError])
 * \~english @retval BKUP_RET_ERRSIZE    Data size error(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusAccessError])
 * \~english @retval BKUP_RET_ERROR      Abnormal termination(@ref McOpenSender failed, or sync message transmission or reception(@ref McInvokeSync) error other than the above)
 * \~english @par Prerequisite
 *        - None.
 * \~english @par Change of internal state
 *        - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *        - If the area ID(tagID) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If the area ID(tagID) specified by the argument is 64 bytes or more than 64 bytes [BKUP_RET_ERRPARAM]
 *        - If the pointer(puiSize) that stores the size specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If system call(pctrl(PR_GET_NAME)) is error [BKUP_RET_ERROR]
 *        - If failed to open the message queue for transmission [BKUP_RET_ERROR]
 *        - If failed to genarate message queue name for synchronous communication [BKUP_RET_ERROR]
 *        - If failed to open the reception message queue for synchronous communication [BKUP_RET_ERROR]
 *        - Sync message transmission or reception(@ref McInvokeSync) error
 *          - If the return value is eFrameworkunifiedStatusInvldParam [BKUP_RET_ERRPARAM]
 *          - If the return value is eFrameworkunifiedStatusErrOther [BKUP_RET_ERRINIT]
 *          - If the return value is eFrameworkunifiedStatusExit [BKUP_RET_ERRTERM]
 *          - If the return value is eFrameworkunifiedStatusFileLoadError [BKUP_RET_ERRNOENT]
 *          - If the return value is eFrameworkunifiedStatusAccessError [BKUP_RET_ERRSIZE]
 *          - If the return value is eFrameworkunifiedStatusFail, it call will synchronization message transmission(@ref McInvokeSync) again after 100 milliseconds later
 *            If the return value is eFrameworkunifiedStatusFail, it will retry BKUP_RETRY_MAX(10) times
 *          - If the return value is other value [BKUP_RET_ERROR]
 *        - If the size specified by the argument does not match the actual size [BKUP_RET_ERROR]
 * \~english @par Detail
 *         Judge the type and access destination according to specified area ID and acquire the size of the target data.
 * \~english @par Classification
 *        Public
 * \~english @par Type
 *        Sync
 * \~english @see
 *        none
 */
int32_t Backup_DataSz(PCSTR tag_id, uint32_t *pui_size);

/**
 * \ingroup Backup_DataRdByNumID
 * \~english @par Brief
 *        Read data from backup area
 * \~english @param [in] numID
 *        uint32_t   - Area ID specified by number
 * \~english @param [in] uiOffset
 *        uint32_t    - Offset from the beginning of the area(0~size of backup area identified by area ID)
 * \~english @param [out] pvBuf
 *        void *    - A pointer which point to buffer used to storage read data
 * \~english @param [in] uiSize
 *        uint32_t     - Read data size(0~size of backup area identified by area ID)
 * \~english @retval BKUP_RET_NORMAL     Terminated normally
 * \~english @retval BKUP_RET_ERRPARAM   Parameter error(Sync message transmission or reception(@ref McInvokeSync) error[eFrameworkunifiedStatusInvldParam])
 * \~english @retval BKUP_RET_ERRINIT    Initializing(Sync message send or receive(@ref McInvokeSync) error [eFrameworkunifiedStatusErrOther])
 * \~english @retval BKUP_RET_ERRTERM    Terminating(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusExit])
 * \~english @retval BKUP_RET_ERRNOENT   Data dose not exist(Sync message transmission or reception(@ref McInvokeSync) fails [eFrameworkunifiedStatusFileLoadError])
 * \~english @retval BKUP_RET_ERRSIZE    Data size error(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusAccessError])
 * \~english @retval BKUP_RET_ERROR      Abnormal termination(@ref McOpenSender failed, or sync message transmission or reception(@ref McInvokeSync) error other than the above)
 * \~english @par Prerequisite
 *        - None.
 * \~english @par Change of internal state
 *        - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *        - If the area ID(tagID) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If the area ID(tagID) specified by the argument is 64 bytes or more than 64 bytes [BKUP_RET_ERRPARAM]
 *        - If the buffer point(pvBuf) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If system call(pctrl(PR_GET_NAME)) is error [BKUP_RET_ERROR]
 *        - If failed to open the message queue for transmission [BKUP_RET_ERROR]
 *        - If failed to genarate message queue name for synchronous communication [BKUP_RET_ERROR]
 *        - If failed to open the reception message queue for synchronous communication [BKUP_RET_ERROR]
 *        - Sync message transmission or reception(@ref McInvokeSync) error
 *          - If the return value is eFrameworkunifiedStatusInvldParam [BKUP_RET_ERRPARAM]
 *          - If the return value is eFrameworkunifiedStatusErrOther [BKUP_RET_ERRINIT]
 *          - If the return value is eFrameworkunifiedStatusExit [BKUP_RET_ERRTERM]
 *          - If the return value is eFrameworkunifiedStatusFileLoadError [BKUP_RET_ERRNOENT]
 *          - If the return value is eFrameworkunifiedStatusAccessError [BKUP_RET_ERRSIZE]
 *          - If the return value is eFrameworkunifiedStatusFail, it call will synchronization message transmission(@ref McInvokeSync) again after 100 milliseconds later
 *            If the return value is eFrameworkunifiedStatusFail, it will retry BKUP_RETRY_MAX(10) times
 *          - If the return value is other value [BKUP_RET_ERROR]
 *        - If the size specified by the argument does not match the actual read size [BKUP_RET_ERROR]
 * \~english @par Detail
 *        Judge the type and access destination according to specified area ID and then read data.
 *        Backup Non-volatile Data Read API for DIAG
 *        Use from the module other than DIAG is prohibited.
 *
 * \~english @par Classification
 *        Public
 * \~english @par Type
 *        Sync
 * \~english @see
 *        Backup_DataRd
 */
int32_t Backup_DataRdByNumID(uint32_t num_id, uint32_t ui_offset, void *pv_buf, uint32_t ui_size);


/**
 * \ingroup Backup_DataSzByNumID
 * \~english @par Brief
 *        Get the size of the backup area.
 * \~english @param [in] numID
 *        uint32_t   - Area ID specified by number
 * \~english @param [out] puiSize
 *        uint32_t *   -  A pointer which point to storage size
 * \~english @retval BKUP_RET_NORMAL     Terminated normally
 * \~english @retval BKUP_RET_ERRPARAM   Parameter error(Sync message transmission or reception(@ref McInvokeSync) error[eFrameworkunifiedStatusInvldParam])
 * \~english @retval BKUP_RET_ERRINIT    Initializing(Sync message send or receive(@ref McInvokeSync) error [eFrameworkunifiedStatusErrOther])
 * \~english @retval BKUP_RET_ERRTERM    Terminating(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusExit])
 * \~english @retval BKUP_RET_ERRNOENT   Data dose not exist(Sync message transmission or reception(@ref McInvokeSync) fails [eFrameworkunifiedStatusFileLoadError])
 * \~english @retval BKUP_RET_ERRSIZE    Data size error(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusAccessError])
 * \~english @retval BKUP_RET_ERROR      Abnormal termination(@ref McOpenSender failed, or sync message transmission or reception(@ref McInvokeSync) error other than the above)
 * \~english @par Prerequisite
 *        - None.
 * \~english @par Change of internal state
 *        - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *        - If the area ID(tagID) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If the area ID(tagID) specified by the argument is 64 bytes or more than 64 bytes [BKUP_RET_ERRPARAM]
 *        - If the pointer(puiSize) that stores the size specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If system call(pctrl(PR_GET_NAME)) is error [BKUP_RET_ERROR]
 *        - If failed to open the message queue for transmission [BKUP_RET_ERROR]
 *        - If failed to genarate message queue name for synchronous communication [BKUP_RET_ERROR]
 *        - If failed to open the reception message queue for synchronous communication [BKUP_RET_ERROR]
 *        - Sync message transmission or reception(@ref McInvokeSync) error
 *          - If the return value is eFrameworkunifiedStatusInvldParam [BKUP_RET_ERRPARAM]
 *          - If the return value is eFrameworkunifiedStatusErrOther [BKUP_RET_ERRINIT]
 *          - If the return value is eFrameworkunifiedStatusExit [BKUP_RET_ERRTERM]
 *          - If the return value is eFrameworkunifiedStatusFileLoadError [BKUP_RET_ERRNOENT]
 *          - If the return value is eFrameworkunifiedStatusAccessError [BKUP_RET_ERRSIZE]
 *          - If the return value is eFrameworkunifiedStatusFail, it call will synchronization message transmission(@ref McInvokeSync) again after 100 milliseconds later
 *            If the return value is eFrameworkunifiedStatusFail, it will retry BKUP_RETRY_MAX(10) times
 *          - If the return value is other value [BKUP_RET_ERROR]
 *        - If the size specified by the argument does not match the actual size [BKUP_RET_ERROR]
 * \~english @par Detail
 *         Judge the type and access destination according to specified area ID and acquire the size of the target data.
 *         Get Non-volatile backup data size API for DIAG
 *         Use from the module other than DIAG is prohibited.
 * \~english @par Classification
 *        Public
 * \~english @par Type
 *        Sync
 * \~english @see
 *        Backup_DataSz
 */
int32_t Backup_DataSzByNumID(uint32_t num_id, uint32_t *pui_size);

/**
 * \ingroup Backup_DataChk
 * \~english @par Brief
 *        Check backup data.
 * \~english @param [in] tagID
 *        PCSTR   - Area ID(character string of less than 64 bytes)
 * \~english @retval BKUP_RET_NORMAL     Terminated normally
 * \~english @retval BKUP_RET_ERRPARAM   Parameter error(Sync message transmission or reception(@ref McInvokeSync) error[eFrameworkunifiedStatusInvldParam])
 * \~english @retval BKUP_RET_ERRINIT    Initializing(Sync message send or receive(@ref McInvokeSync) error [eFrameworkunifiedStatusErrOther])
 * \~english @retval BKUP_RET_ERRTERM    Terminating(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusExit])
 * \~english @retval BKUP_RET_ERRNOENT   Data dose not exist(Sync message transmission or reception(@ref McInvokeSync) fails [eFrameworkunifiedStatusFileLoadError])
 * \~english @retval BKUP_RET_ERRSIZE    Data size error(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusAccessError])
 * \~english @retval BKUP_RET_ERROR      Abnormal termination(@ref McOpenSender failed, or sync message transmission or reception(@ref McInvokeSync) error other than the above)
 * \~english @par Prerequisite
 *        - None.
 * \~english @par Change of internal state
 *        - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *        - If the area ID(tagID) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If the area ID(tagID) specified by the argument is 64 bytes or more than 64 bytes [BKUP_RET_ERRPARAM]
 *        - If system call(pctrl(PR_GET_NAME)) is error [BKUP_RET_ERROR]
 *        - If failed to open the message queue for transmission [BKUP_RET_ERROR]
 *        - If failed to genarate message queue name for synchronous communication [BKUP_RET_ERROR]
 *        - If failed to open the reception message queue for synchronous communication [BKUP_RET_ERROR]
 *        - Sync message transmission or reception(@ref McInvokeSync) error
 *          - If the return value is eFrameworkunifiedStatusInvldParam [BKUP_RET_ERRPARAM]
 *          - If the return value is eFrameworkunifiedStatusErrOther [BKUP_RET_ERRINIT]
 *          - If the return value is eFrameworkunifiedStatusExit [BKUP_RET_ERRTERM]
 *          - If the return value is eFrameworkunifiedStatusFileLoadError [BKUP_RET_ERRNOENT]
 *          - If the return value is eFrameworkunifiedStatusAccessError [BKUP_RET_ERRSIZE]
 *          - If the return value is eFrameworkunifiedStatusFail, it call will synchronization message transmission(@ref McInvokeSync) again after 100 milliseconds later
 *            If the return value is eFrameworkunifiedStatusFail, it will retry BKUP_RETRY_MAX(10) times
 *          - If the return value is other value [BKUP_RET_ERROR]
 *        - If the size specified by the argument does not match the actual read size [BKUP_RET_ERROR]
 * \~english @par Detail
 *        Judge the type and access destination according to specified area ID and check the target data.
 * \~english @par Classification
 *        Public
 * \~english @par Type
 *        Sync
 * \~english @see
 *        none
 */
int32_t Backup_DataChk(PCSTR tag_id);

/**
 * \ingroup Backup_DataDel
 * \~english @par Brief
 *        Delete backup data.
 * \~english @param [in] tag_id
 *        PCSTR   - Area ID(character string of less than 64 bytes)
 * \~english @retval BKUP_RET_NORMAL     Terminated normally
 * \~english @retval BKUP_RET_ERRPARAM   Parameter error(Sync message transmission or reception(@ref McInvokeSync) error[eFrameworkunifiedStatusInvldParam])
 * \~english @retval BKUP_RET_ERRINIT    Initializing(Sync message send or receive(@ref McInvokeSync) error [eFrameworkunifiedStatusErrOther])
 * \~english @retval BKUP_RET_ERRTERM    Terminating(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusExit])
 * \~english @retval BKUP_RET_ERRSIZE    Data size error(Sync message transmission or reception(@ref McInvokeSync) error [eFrameworkunifiedStatusAccessError])
 * \~english @retval BKUP_RET_ERROR      Abnormal termination(@ref McOpenSender failed, or sync message transmission or reception(@ref McInvokeSync) error other than the above)
 * \~english @par Prerequisite
 *        - None.
 * \~english @par Change of internal state
 *        - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *        - If the area ID(tagID) specified by the argument is NULL [BKUP_RET_ERRPARAM]
 *        - If the area ID(tagID) specified by the argument is 64 bytes or more than 64 bytes [BKUP_RET_ERRPARAM]
 *        - If system call(pctrl(PR_GET_NAME)) is error [BKUP_RET_ERROR]
 *        - If failed to open the message queue for transmission [BKUP_RET_ERROR]
 *        - If failed to genarate message queue name for synchronous communication [BKUP_RET_ERROR]
 *        - If failed to open the reception message queue for synchronous communication [BKUP_RET_ERROR]
 *        - Sync message transmission or reception(@ref McInvokeSync) error
 *          - If the return value is eFrameworkunifiedStatusInvldParam [BKUP_RET_ERRPARAM]
 *          - If the return value is eFrameworkunifiedStatusErrOther [BKUP_RET_ERRINIT]
 *          - If the return value is eFrameworkunifiedStatusExit [BKUP_RET_ERRTERM]
 *          - If the return value is eFrameworkunifiedStatusAccessError [BKUP_RET_ERRSIZE]
 *          - If the return value is eFrameworkunifiedStatusFail, it call will synchronization message transmission(@ref McInvokeSync) again after 100 milliseconds later
 *            If the return value is eFrameworkunifiedStatusFail, it will retry BKUP_RETRY_MAX(10) times
 *          - If the return value is other value [BKUP_RET_ERROR]
 * \~english @par Detail
 *        Judge the type and access destination according to specified area ID and delete the target data.
 *        - If the target data does not exist, return value is terminated normally. [BKUP_RET_NORMAL]
 * \~english @par Classification
 *        Public
 * \~english @par Type
 *        Sync
 * \~english @see
 *        none
 */
int32_t Backup_DataDel(PCSTR tag_id);

#ifdef __cplusplus
}
#endif /*__cplusplus  */

/**@}*/  // end of backup_manager
/**@}*/  // end of native_service
/**@}*/  // end of BaseSystem

#endif  // BACKUP_MANAGER_CLIENT_INCLUDE_NATIVE_SERVICE_NS_BACKUP_H_