123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749 |
- /**
- * Copyright(c) 2011 Sunmedia Technologies - All Rights Reserved.
- *
- * @file
- *
- * @brief Provides common includes, macros, external declarations and definitions
- * of Common DataBase Interface module.
- *
- * @author liang.wu
- * @author jun.luo
- */
- #ifndef _CDBI_H_
- #define _CDBI_H_
- #include "db_common.h"
- #include "cdb.h"
- #include "tdb.h"
- #include "sdb.h"
- #include "adb.h"
- #include "sbtvddb.h"
- #ifdef __cplusplus
- extern "C"{
- #endif
- /**
- * @brief defines maxism number of callback function registered by upper layer.
- */
- #define MAX_CALLBACK_FP (10)
- /**
- * @brief The invalid record handle
- */
- #define CDBI_INVALID_HDL (0)
- /**
- * @brief It is an opaque type specific to the target platform. It is a unique identifier for each record.
- */
- typedef UINT32 CDBIHandle_t;
- /**
- * @brief Macro for CDBI Error calling prompt message
- */
- #define CDBI_FUNC_CALL(funcCall) do { \
- if ((funcCall) != DB_SUCCESS)\
- {\
- UMFDBG(0,"[Error]%s: %d Line ", __FUNCTION__, __LINE__); \
- UMFDBG(0,"%s return failed~\n", #funcCall);\
- } \
- } while(0)
- /**
- * @brief Enumeration of database type for CDBI internal use
- */
- typedef enum
- {
- DBTYPE_ATV = 0x01, /**< Analog channel database*/
- DBTYPE_T = 0x02, /**< Terrestrial channel database*/
- DBTYPE_C = 0x04, /**< Cable channel database*/
- DBTYPE_S = 0x08, /**< Satellite channel database*/
- DBTYPE_SBTVD= 0x20, /**< SBTVD channel database*/
- #if 1
- DBTYPE_OOB = 0x10, /**< Out-of-band channel database*/
- DBTYPE_MASK = DBTYPE_ATV|DBTYPE_T|DBTYPE_C|DBTYPE_S|DBTYPE_OOB, /**< database type mask*/
- #endif
- DBTYPE_DVB = 0x80, /**< DVB system*/
- #if 1
- DBTYPE_ATSC = 0x40, /**< ATSC system*/
- #endif
- } EDBInnerType_t;
- /**
- * @brief Enumeration of all the supported databases including DVB & ATSC
- */
- typedef enum
- {
- CDBI_DBTYPE_DVB_ATV = DBTYPE_DVB | DBTYPE_ATV, /**< DVB Analog channel database*/
- CDBI_DBTYPE_DVB_T = DBTYPE_DVB | DBTYPE_T, /**< DVB Terrestrial channel database*/
- CDBI_DBTYPE_DVB_C = DBTYPE_DVB | DBTYPE_C, /**< DVB Cable channel database*/
- CDBI_DBTYPE_DVB_S = DBTYPE_DVB | DBTYPE_S, /**< DVB Satellite channel database*/
- CDBI_DBTYPE_DVB_SBTVD = DBTYPE_DVB | DBTYPE_SBTVD, /**< SBTVD channel database*/
- #if 1
- CDBI_DBTYPE_ATSC_NTSC = DBTYPE_ATSC | DBTYPE_ATV, /**<NTSC - Analog channel database */
- CDBI_DBTYPE_ATSC_T = DBTYPE_ATSC | DBTYPE_T, /**<ATSC Terrestrial channel database */
- CDBI_DBTYPE_ATSC_C = DBTYPE_ATSC | DBTYPE_C, /**<ATSC Cable channel database */
- CDBI_DBTYPE_ATSC_S = DBTYPE_ATSC | DBTYPE_S, /**<ATSC Satellite channel database */
- CDBI_DBTYPE_ATSC_OOB = DBTYPE_ATSC | DBTYPE_OOB, /**<ATSC cable channel -- through OOB Stream */
- #endif
- #if 0
- CDBI_DBTYPE_ATSC_NTSC = CDBI_DBTYPE_ATSC | DBTYPE_ATV, /**<NTSC - Analog channel database */
- CDBI_DBTYPE_ATSC_T = CDBI_DBTYPE_ATSC | DBTYPE_T, /**<ATSC Terrestrial channel database */
- CDBI_DBTYPE_ATSC_C = CDBI_DBTYPE_ATSC | DBTYPE_C, /**<ATSC Cable channel database */
- CDBI_DBTYPE_ATSC_S = CDBI_DBTYPE_ATSC | DBTYPE_S, /**<ATSC Satellite channel database */
- CDBI_DBTYPE_ATSC_OOB = CDBI_DBTYPE_ATSC | CDBI_DBTYPE_OOB, /**<ATSC cable channel -- through OOB Stream */
- #endif
- } ECDBIDBType_t;
- /**
- * @brief Enumeration of all the supported record type
- */
- typedef enum
- {
- CDBI_RECTYPE_DVBTV = SERVICE_DVB_TV, /**< DVB TV record*/
- CDBI_RECTYPE_DVBRADIO = SERVICE_DVB_RADIO, /**< DVB Radio record*/
- CDBI_RECTYPE_DVBDATA = SERVICE_DVB_DATA, /**< DVB Data service record*/
- CDBI_RECTYPE_DVBSERVICE = SERVICE_DVB_ALL, /**< DVB TV or Radio or data record*/
- CDBI_RECTYPE_ATVSERVICE = SERVICE_ATV, /**< ATV channel record*/
- CDBI_RECTYPE_DVBNETWORK = 1 << 4, /**< DVB Network record*/
- CDBI_RECTYPE_DVBMULTIPLEX = 1 << 5, /**< DVB Mulitplex record*/
- } ECDBIRecordType_t;
- /**
- * @brief Defines data structure for upper layer to get database capacity
- */
- typedef struct
- {
- UINT32 MaxNetwork; /**< Max number of Network supported*/
- UINT32 MaxMultiplex; /**< Max number of Multiplex supported*/
- UINT32 MaxService; /**< Max number of Service supported*/
- } CDBICapability_t;
- /** None volatile memory read function prototype define */
- typedef EDBError_t (*pfNVMRead)(ECDBIDBType_t enDBType, UINT32 uiStart, UINT32 uiBytes, void *pBuff);
- /** None volatile memory write function prototype define */
- typedef EDBError_t (*pfNVMWrite)(ECDBIDBType_t enDBType, UINT32 uiStart, UINT32 uiBytes, void const *pBuff);
- /** Type define of None Volatile Memory operations */
- typedef struct
- {
- pfNVMRead fNVMRead;
- pfNVMWrite fNVMWrite;
- } DBNVMOperate_t;
- /**
- * @brief The prototype of the callback to be registed to match record(Service, Multiplex, Network),
- * used by:
- * 1.Search function, refer to CDBIFindRecord();
- * 2.Add record function, used to check the duplicate Record, refer to CDBIAddRecord().
- *
- * param - parameter for match function
- *
- * pRec - The record(Service, Multiplex, Network) exist in database
- *
- * if return value
- * = TRUE - Match pRecord with given condition
- * = FALSE - Not match pRecord with given condition
- */
- typedef bool (*fpCDBIRecMatch)(void *param, void const*pRec);
- /**
- * @brief The prototype of the callback to be registed to sort record(Service, Multiplex, Network),
- *
- * param pRec1, pRec2- pointer to the content of record(Service, Multiplex, Network) exist in database
- *
- * if return value
- * = 0 - Both services are of same type
- * +ve - The first record is greater than second record
- * -ve - The second record is greater than first record
- */
- typedef INT32 (*fpCDBIRecUserCmp)(void const *pRec1, void const *pRec2);
- /**
- * @brief The prototype of the callback to be registed to process duplicate records(Service, Multiplex, Network),
- *
- * peTuneType - tune type, duplicate service processing rule need this information
- * pePriSpec - Private spec type, duplicate service processing rule need this information
- * ucPreSSI, ucPreSQI - The Signal Strength and Quality for previous service
- * ucCurSSI, ucCurSQI - The Signal Strength and Quality for current service
- *
- * SSI -- Signal Strength Indicator;SQI -- Signal Quality Indicator
- *
- * if return value
- * = DB_DUPLIREC_RESERVE_FORMER - The former has high priority, discard the later or delete the latter if it has added
- * = DB_DUPLIREC_RESERVE_LATTER - The latter has high priority, discard the former or delete the former if it has added
- * = DB_DUPLIREC_RESERVE_ALL - Reserved two services, this behavior is required by some spec(such as Z-Book)
- */
- typedef EDBDupliRecStrategy_t (*fpCDBIGetDupliRecStrategy)(EDBTuneType_t *peTuneType, EDBPrivateSpec_t *pePriSpec, UINT8 ucPreSSI, UINT8 ucPreSQI, UINT8 ucCurSSI, UINT8 ucCurSQI);
- /**
- * @brief Defines data ructure for upper layer to set duplicate condtion for each record type
- */
- typedef struct
- {
- fpCDBIRecMatch pNetDupliChk; /**< Duplicate Network check callback */
- fpCDBIRecMatch pMultipDupliChk; /**< Duplicate Multiplex check callback */
- fpCDBIRecMatch pServDupliChk; /**< Duplicate Service check callback */
- } CDBIRecDupliChk_t;
- /**
- * @brief The prototype of the callback to be registed to set record to default value
- *
- * enDBType - The database type.
- *
- * eRecType - The Record type.
- *
- * pEntry - A pointer to the db entry that it will be reset.
- *
- * uiChannelIdx - Indicate the channel index.
- *
- */
- typedef void CDBISetRec2DefVal_t(ECDBIDBType_t enDBType, ECDBIRecordType_t eRecType, void const *pEntry, UINT32 uiChannelIdx);
- /**
- * @brief The callback function prototype for the db watcher
- * This will be called whenever there is a change in database.
- *
- * @note Please don't use whichever CDBI APIs when implement this callback to avoid deadlock.
- */
- typedef void CDBIWatcher_t(ECDBIDBType_t enDBType, EDBEvent_t enEVEType, void *pEntry);
- /**
- * @brief Initialize cdbi, assigne NVM handlers and operation parameters to RMGR etc.
- *
- * @param CDBIInitParam Contain NVM parameters and NVM handlers etc.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIInitialize(DBNVMOperate_t *CDBIInitParam);
- /**
- * @brief UnInitialize CDBI.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIUnInitialize(void);
- /**
- * @brief Check whether the given database module is active
- *
- * @param enDBType[in] specify which database.
- *
- * @param pActive[out] whether Active.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetDBModuleActive(ECDBIDBType_t enDBType, bool *pActive);
- /**
- * @brief active on inactive the specify DB module.
- *
- * @param enDBType[in] specify which database.
- *
- * @param bActive[in] active the specify DB module if true, else inactive this specify DB module.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIActiveDBModule(ECDBIDBType_t enDBType, bool bActive);
- /**
- * @brief active or deactive LCN procedures to process LCN for specify DB Module.
- *
- * @param enDBType[in] specify which database .
- *
- * @param bActive[in] active LCN procedure for enDBType if true, else inactive.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t CDBIActiveLCNProc4DB(ECDBIDBType_t enDBType, bool bActive);
- /**
- * @brief Reset given database
- *
- * @param enDBType specify which database to be reset
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIResetDBModule(ECDBIDBType_t enDBType);
- /**
- * @brief Sync given database to storage device, like FLASH or EEPROM
- *
- * @param enDBType specify which database to sync
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBISyncDBModule(ECDBIDBType_t enDBType);
- /**
- * @brief Register Record default value setter.
- *
- * @param fpSetRec2DefVal The callback function pointer.
- *
- * @note This function only support reseting the detail of ATV Service to default value at present.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIRegisterDBRecDefValSetter(CDBISetRec2DefVal_t *fpSetRec2DefVal);
- /**
- * @brief Register database watcher to specified database with specified event
- *
- * @param enDBType specify which database to watch
- *
- * @param enEventType A set of events to watch
- *
- * @param fpWatcher callback function pointer
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIRegisterDBWatcher(ECDBIDBType_t enDBType, EDBEvent_t enEventType, CDBIWatcher_t *fpWatcher);
- /**
- * @brief UnRegister database watcher to specified database with specified event
- *
- * @param fpWatcher callback function pointer
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIUnRegisterDBWatcher(ECDBIDBType_t enDBType, EDBEvent_t enEventType, CDBIWatcher_t *fpUnWatcher);
- /**
- * @brief Register database match function to set duplicate condition by upper layer
- *
- * @param enDBType specify which database to watch
- *
- * @param pStFunc Pointer to a set of duplicate condtion for each record type
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIRegisterRecMatchFunc(ECDBIDBType_t enDBType, CDBIRecDupliChk_t *pStFunc);
- /**
- * @brief Register callback to process duplicate service
- *
- * @param pFunc Function Pointer to get the process strategy when duplicate services exist,
- * it will be instead by inner default duplicate service processing procedure if it is NULL.
- *
- * @param peTuneType Current tune type.
- *
- * @param pePriSpec Private spec.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIRegisterDupliRecStrategy(fpCDBIGetDupliRecStrategy pFunc, EDBTuneType_t *peTuneType, EDBPrivateSpec_t *pePriSpec);
- /**
- * @brief Get database capacity by given database type
- *
- * @param enDBType specify which database to get
- *
- * @param pstCapbility pointer to Capability data structure
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetCapability(ECDBIDBType_t enDBType, CDBICapability_t *pstCapbility);
- EDBError_t CDBIGetFirstRecordEx(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, CDBIHandle_t * hRec);
- EDBError_t CDBIGetNextRecordEx(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, CDBIHandle_t * hRec);
- /**
- * @brief Get first record handle by given database type and record type
- *
- * @param enDBType specify which database to get
- *
- * @param enRecType record type
- *
- * @param hRec the first record handle
- *
- * @note for getting Service, all deleted services will be ignored.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetFirstRecord(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, CDBIHandle_t *hRec);
- /**
- * @brief Get Next record handle by given current database handle
- *
- * @param hCurRec current record handle
- *
- * @param enRecType record type
- *
- * @param hNextRec next record handle
- *
- * @note for getting Service, all deleted services will be ignored.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetNextRecord(CDBIHandle_t hCurRec, ECDBIRecordType_t enRecType, CDBIHandle_t *hNextRec);
- /**
- * @brief Get Previous record handle by given current database handle
- *
- * @param hCurRec current record handle
- *
- * @param enRecType record type
- *
- * @param hPrevRec the previous record handle
- *
- * @note for getting Service, all deleted services will be ignored.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetPrevRecord(CDBIHandle_t hCurRec, ECDBIRecordType_t enRecType, CDBIHandle_t *hPrevRec);
- /**
- * @brief Get Last record handle by given database type and record type
- *
- * @param enDBType specify which database to get
- *
- * @param enRecType record type
- *
- * @param hRec the last record handle
- *
- * @note for getting Service, all deleted services will be ignored.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetLastRecord(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, CDBIHandle_t *hRec);
- /**
- * @brief This function is to get the next matching(the record for which the match function returns TRUE)
- * record handle by given search parameter.
- * @note
- * 1.You can use:
- * CDBIHandle_t phRec = CDBI_INVALID_HDL;
- * while (DB_SUCCESS == CDBIFindRecord(..., TRUE, &phRec))
- * {
- * ...
- * }
- * or
- * while (DB_SUCCESS == CDBIFindRecord(..., FALSE, &phRec))
- * {
- * ...
- * }
- * to get all the Records which match the given search condition, distinguish that:
- * The former has an ascending order and the latter has a descending order;
- * 2. The value of enRecType(parameter 2) can't use combinatorial key
- * such as CDBI_RECTYPE_DVBTV | CDBI_RECTYPE_DVBRADIO ;
- * 3. For Service Searching, the result maybe contain the deleted services,
- * which depend on the implement of fpMatchFunc;
- * 4. Only support Service Searching in fact currently...
- *
- * @param enDBType[in] specify which database to get.
- *
- * @param enRecType[in] record type, refer to ECDBIRecordType_t.
- *
- * @param fpMatchFunc[in] Match function registed by upper layer.
- *
- * @param pMatchParam[in] Match parameters for fpMatchFunc.
- *
- * @param bAscending Search ascending or descending
- *
- * @param phRec[in/out] pointer to record handle.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t CDBIFindRecord(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, fpCDBIRecMatch fpMatchFunc,
- void *pMatchParam, bool bAscending, CDBIHandle_t *phRec);
- /**
- * @brief Anather function used to get the numbers of matching(the record for which the match function returns TRUE)
- * record handle by given search parameter.
- * @note
- * Upper layer must given the buffer given by phRec to store service handls
- *
- * @param enDBType[in] specify which database to get.
- *
- * @param enRecType[in] record type, refer to ECDBIRecordType_t.
- *
- * @param fpMatchFunc[in] Match function registed by upper layer.
- *
- * @param pMatchParam[in] Match parameters for fpMatchFunc.
- *
- * @param bAscending[in] Search ascending or descending
- *
- * @param uiSkipNum[in] skip number of record
- *
- * @param phRec[in/out] one buffer used to store service handles.
- *
- * @param puiRecNum[in/out] specified the given buffer size and output the actural number of matched records .
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t CDBIFindRecordExt(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, fpCDBIRecMatch fpMatchFunc,
- void *pMatchParam, bool bAscending, UINT32 uiSkipNum, CDBIHandle_t *phRec, UINT32 *puiRecNum);
- /**
- * @brief Get Record parant by record handle
- *
- * @param hChildRec child record handle
- *
- * @param hDstRec parent record handle
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetParentRec(CDBIHandle_t hChildRec, CDBIHandle_t *hParentRec);
- /**
- * @brief Get the number of children for the given parent record handle
- *
- * @param hRec Parent record handle
- *
- * @param RecNum Number of children record
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means some error occurs.
- */
- EDBError_t CDBIGetNoOfChildrenRec(CDBIHandle_t hRec, UINT32 *RecNum);
- /**
- * @brief Get the next child for the the given record handle
- *
- * @param hParentRec Parent record handle
- *
- * @param phChildRec Child record handle
- *
- * @note
- * You can use:
- * CDBIHandle_t phRec = CDBI_INVALID_HDL;
- * while (DB_SUCCESS == CDBIChildRecTraversal(hParentRec, &phRec))
- * {
- * ...
- * }
- * to get all the child records.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means the traversal is completed.
- */
- EDBError_t CDBIChildRecTraversal(CDBIHandle_t hParentRec, CDBIHandle_t *phChildRec);
- /**
- * @brief check whether has child record.
- *
- * @param hParentRec record handle, it can be network or multiplex
- *
- * @param bHasChild check its whether has child
- *
- * @param bHasGrandChild check its whehter has grand child,
- *
- *
- * @note
- * if hParentRec is mulplex, this para is invalid.
- *
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t CDBIHasChildRec(CDBIHandle_t hParentRec, bool *bHasChild, bool *bHasGrandChild);
- /**
- * @brief check whether has child record.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t CDBICheckRecValid(CDBIHandle_t hRec, bool *bIsValid);
- /**
- * @brief Add new record into database
- *
- * @param enDBType specify which database to add
- *
- * @param enRecType record type
- *
- * @param pstRecDetails record details
- *
- * @param hParent to which current record is add(If current record don't has parent, given CDBI_INVALID_HDL)
- *
- * @param hRec record handle
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIAddRec(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, void const *pstRecDetails,
- CDBIHandle_t hParent, CDBIHandle_t *hRec);
- #ifdef DVBS_DB_SUPPORT
- /**
- * @brief copy record, the old and new has the same parent
- *
- * @param hCurRec the old record handle
- *
- * @param hNewRec the new record handle
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBICopyRec(CDBIHandle_t hCurRec, CDBIHandle_t *hNewRec);
- #endif
- /**
- * @brief Update record field information by given member
- *
- * @param hRec specify the record to be update
- *
- * @param FieldValue pointer to field value
- *
- * @param pSymbol the member name
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIUpdateRecBySymbol(CDBIHandle_t hRec, const void *FieldValue, UINT8 *pSymbol);
- /**
- * @brief Get record field information by given member
- *
- * @param hRec specify the record to be update
- *
- * @param FieldValue pointer to field value
- *
- * @param pSymbol the member name
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetRecBySymbol(CDBIHandle_t hRec, void *FieldValue, UINT8 *pSymbol);
- /**
- * @brief Update record field information by given handle
- *
- * @param hRec specify the record to be update
- *
- * @param FieldValue pointer to field value
- *
- * @param Offset the offset start from first byte of the record data structure
- *
- * @param Length field length
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIUpdateRec(CDBIHandle_t hRec, const void *FieldValue, UINT16 Offset, UINT16 Length);
- /**
- * @brief Get record field information by given handle
- *
- * @param hRec specify the record to be update
- *
- * @param FieldValue pointer to field value
- *
- * @param Offset the offset start from first byte of the record data structure
- *
- * @param Length field length
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetRec(CDBIHandle_t hRec, void *FieldValue, UINT16 Offset, UINT16 Length);
- /**
- * @brief Remove record from database
- *
- * @param hRec specify the record to be update
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIRemoveRec(CDBIHandle_t hRec);
- /**
- * @brief Get total number of certain type of record in database
- *
- * @note the deleted services will be ignored
- *
- * @param enDBType specify which database to get
- *
- * @param enRecType record type
- *
- * @param RecNum pointer to total number
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetNoOfRecInDB(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, UINT32 *RecNum);
- /**
- * @brief Get record sorting list.
- *
- * @param enDBType specify which database to sort
- *
- * @param enRecType record type to sort
- *
- * @param pRecList record sorting list
- *
- * @param pRecNum number of records in sorting list
- *
- * @note Only used to -S service sorting list.
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetRecSortList(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, CDBIHandle_t *pRecList, UINT16 *pRecNum);
- /**
- * @brief Sort record
- *
- * @param enDBType specify which database to sort
- *
- * @param enRecType record type to sort
- *
- * @param enSortType sorting method
- *
- * @param bAscending sort ascending or descending
- *
- * @note for parameter enRecType, because all services belong to one DB Module are handled by one list,
- * so CDBI_RECTYPE_DVBTV, CDBI_RECTYPE_DVBRADIO, CDBI_RECTYPE_DVBDATA is invalid)
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBISortRec(ECDBIDBType_t enDBtype, ECDBIRecordType_t enRecType, EDBSortType_t enSortType, bool bAscending);
- /**
- * @brief Sort record with cmp callback function provided by user
- *
- * @param enDBType specify which database to sort
- *
- * @param enRecType record type to sort
- *
- * @param pUserCmpCB record compare callback function
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBISortRecByUser(ECDBIDBType_t enDBType, ECDBIRecordType_t enRecType, fpCDBIRecUserCmp pUserCmpCB);
- /**
- * @brief Swap record
- *
- * @param hSrcRec1 the first record handle
- *
- * @param hSrcRec2 the second record handle
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBISwapRec(CDBIHandle_t hSrcRec1, CDBIHandle_t hSrcRec2);
- /**
- * @brief Move Src record to DstRec
- *
- * @param hSrcRec src record handle
- *
- * @param hDstRec dst record handle
- *
- * @param bFront move hSrcRec to the front of hDestRec if true, else move to the hind of hDestRec
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIMoveRec(CDBIHandle_t hSrcRec, CDBIHandle_t hDstRec, bool bFront);
- /**
- * @brief Get Record type and database type by Record handle
- *
- * @param hRec record handle
- *
- * @param DBType database type of the record
- *
- * @param RecType record type of the record
- *
- * @retval DB_SUCCESS means succss. DB_FAILURE means failed.
- */
- EDBError_t CDBIGetRecTypeAndDBType(CDBIHandle_t hRec, ECDBIDBType_t *DBType, ECDBIRecordType_t *RecType);
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
- #endif
|