3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #ifndef OMA_DM_STATUS_DB_HANDLER_H_
19 #define OMA_DM_STATUS_DB_HANDLER_H_
22 #include "common/dm_error.h"
23 #include "common/dm-status/oma_dm_status_db_common.h"
26 * ==================================
27 * external API (1. about db handler mgr)
28 * ==================================
32 * @par Description: API to alloc the db handler manager
36 * @par Typical use case:
37 * @par Method of function operation:
38 * @par Important notes:
40 * @return DM_OK on success
41 * DM_ERR_UNKNOWN or Other DM_ERROR
54 DM_ERROR Alloc_DB_Handler_Mgr();
57 * @par Description: API to free the db handler manager
61 * @par Typical use case:
62 * @par Method of function operation:
63 * @par Important notes:
65 * @return DM_OK on success
66 * DM_ERR_UNKNOWN or Other DM_ERROR
79 DM_ERROR Free_DB_Handler_Mgr();
82 * @par Description: API to free engine structure
86 * @par Typical use case:
87 * @par Method of function operation:
88 * @par Important notes:
89 * @param[in] free structure count
90 * @param[in] engine_status structure
106 void Free_Memory_Engine_Status(engine_status ** status, int count);
109 * ==================================
110 * external API (2. about agent db )
111 * ==================================
114 * =============================================================================================================================
115 * Database Open & Close & Create table
116 * =============================================================================================================================
120 * @par Description: API to dm_service db open
124 * @par Typical use case:
125 * @par Method of function operation:
126 * @par Important notes:
128 * @return DM_OK on success
129 * DM_ERR_UNKNOWN or Other DM_ERROR
146 * @par Description: API to dm_service db close
150 * @par Typical use case:
151 * @par Method of function operation:
152 * @par Important notes:
172 * @par Description: API to create dm_service db
176 * @par Typical use case:
177 * @par Method of function operation:
178 * @par Important notes:
180 * @return DM_OK on success
181 * DM_ERR_UNKNOWN or Other DM_ERROR
195 DM_ERROR DB_Create_Table();
198 * @par Description: API to delete dm_service db
202 * @par Typical use case:
203 * @par Method of function operation:
204 * @par Important notes:
206 * @return DM_OK on success
207 * DM_ERR_UNKNOWN or Other DM_ERROR
221 DM_ERROR DB_Delete_Table();
224 * @par Description: API to reset dm_service db
228 * @par Typical use case:
229 * @par Method of function operation:
230 * @par Important notes:
232 * @return DM_OK on success
233 * DM_ERR_UNKNOWN or Other DM_ERROR
247 DM_ERROR DB_Reset_Table();
250 * =============================================================================================================================
251 * Control Transaction
252 * =============================================================================================================================
255 * @par Description: API to begin transaction dm_service db
259 * @par Typical use case:
260 * @par Method of function operation:
261 * @par Important notes:
263 * @return DM_OK on success
264 * DM_ERR_UNKNOWN or Other DM_ERROR
278 DM_ERROR DB_Begin_Transaction();
281 * @par Description: API to end transaction dm_service db
285 * @par Typical use case:
286 * @par Method of function operation:
287 * @par Important notes:
288 * @param[in] DB_TRANSACTION ( commit, rollback)
290 * @return DM_OK on success
291 * DM_ERR_UNKNOWN on error
305 DM_ERROR DB_End_Transaction(DB_TRANSACTION transaction);
308 * =============================================================================================================================
309 * engine_status table
310 * =============================================================================================================================
313 * @par Description: API to init engine status
317 * @par Typical use case:
318 * @par Method of function operation:
319 * @par Important notes:
321 * @return DM_OK on success
322 * DM_ERR_UNKNOWN or Other DM_ERROR
336 DM_ERROR Init_Engine_Status();
339 * @par Description: API to add engine status row in db
343 * @par Typical use case:
344 * @par Method of function operation:
345 * @par Important notes:
346 * @param[in] engine_status structure
348 * @return DM_OK on success
349 * DM_ERR_UNKNOWN or Other DM_ERROR
363 DM_ERROR Add_Engine_Status(engine_status * status);
366 * @par Description: API to delete engine status in db
370 * @par Typical use case:
371 * @par Method of function operation:
372 * @par Important notes:
373 * @param[in] engine_status id
375 * @return DM_OK on success
376 * DM_ERR_UNKNOWN or Other DM_ERROR
390 DM_ERROR Delete_Engine_Status(int engine_id);
393 * @par Description: API to update engine status in db
397 * @par Typical use case:
398 * @par Method of function operation:
399 * @par Important notes:
400 * @param[in] engine_status structure
402 * @return DM_OK on success
403 * DM_ERR_UNKNOWN or Other DM_ERROR
417 DM_ERROR Update_Engine_Status(engine_status * status);
420 * @par Description: API to update engine status column in db
424 * @par Typical use case:
425 * @par Method of function operation:
426 * @par Important notes:
427 * @param[in] engine_status id
428 * @param[in] engine_status key
429 * @param[in] engine_status value
431 * @return DM_OK on success
432 * DM_ERR_UNKNOWN or Other DM_ERROR
446 DM_ERROR Update_Engine_Status_Column(int engine_id, ENGINE_STATUS_VALUE engine_status_value, void *value);
449 * @par Description: API to get engine status structure in db
453 * @par Typical use case:
454 * @par Method of function operation:
455 * @par Important notes:
456 * @param[in] engine_status id
457 * @param[out] engine_status structure
459 * @return DM_OK on success
460 * DM_ERR_UNKNOWN or Other DM_ERROR
474 DM_ERROR Get_Engine_Status(int engine_id, engine_status ** status);
477 * @par Description: API to get engine status structure in db
481 * @par Typical use case:
482 * @par Method of function operation:
483 * @par Important notes:
484 * @param[out] engine_status structure list
485 * @param[out] engine_status structure count
487 * @return DM_OK on success
488 * DM_ERR_UNKNOWN or Other DM_ERROR
502 DM_ERROR Get_AII_Engine_Status(engine_status ** status_list, int *count);
505 * @par Description: API to check exist engine status structure in db
509 * @par Typical use case:
510 * @par Method of function operation:
511 * @par Important notes:
512 * @param[in] engine_status id
514 * @return DM_OK on success
515 * DM_ERR_UNKNOWN or Other DM_ERROR
529 int IsExist_Engine_id(int engine_id);
531 #endif /* OMA_DM_STATUS_DB_HANDLER_H_ */