123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 |
- /**
- * Copyright(c) 2011 Sunmedia Technologies - All Rights Reserved.
- *
- * @file
- * macros, declarations and definitions for LCN Process.
- *
- * @author jun.luo
- *
- */
- #ifndef _DB_LCN_H_
- #define _DB_LCN_H_
- #include "db_common.h"
- #include "cdbi.h"
- #ifdef __cplusplus
- extern "C"{
- #endif
- #define HAS_LCN(ProgNum) (ProgNum & (DB_DVB_LCN_INDICATOR | DB_DVB_LCN2_INDICATOR))
- #define HAS_NORDIGV2_LCN(ProgNum) (ProgNum & DB_DVB_LCN2_INDICATOR)
- #define GET_LCN(ProgNum) (ProgNum & ~(DB_DVB_LCN_INDICATOR | DB_DVB_LCN2_INDICATOR))
- /* Exported constants */
- enum
- {
- DB_DVB_MAX_LCN_CONF_PROG = 10, /**< Define the max number of program have the same LCN number */
- DB_DVB_LCN_INDICATOR = 0x8000, /**<If a programe index MSB is set, it indicate a LCN number */
- DB_DVB_LCN2_INDICATOR = 0x4000, /**< Indicator for LCN version 2, actural used by Nordig */
- //#ifdef SUPPORT_DVBS_LCN
- DB_DVB_LCN_MASK = 0x3FFF,
- //#else
- //DB_DVB_LCN_MASK = 0x3FF,
- //#endif
- DB_DVB_MAX_CHNLIST_NUM = 10, /**< The value is the same with MAX_SGT_SEVLIST_NUM define */
- DB_DVB_MAX_CHNLIST_NAME_LEN = 40, /* Ghana spec required 23 bytes, and ASTRA LCN Spec required 31 bytes */
- DB_DVB_MAX_MULTILCN_NUM = 10, /**< Ghana use idx 0, ASTRA LCN use all slots(Actually we are not sure what is the maximum ?) */
- };
- /**< LCN Rule type */
- typedef enum
- {
- DB_DVB_LCNRULE_GBR = 0, /**< lcn sort rule of UK */
- DB_DVB_LCNRULE_ITA, /**< lcn sort rule of Italy */
- DB_DVB_LCNRULE_NORDIG, /**< lcn sort rule of Nordig */
- DB_DVB_LCNRULE_GHA, /**< lcn sort rule of Ghana */
- DB_DVB_LCNRULE_THA, /**< lcn sort rule of Thailand */
- DB_DVB_LCNRULE_NLD, /**< lcn sort rule of Netherlands */
- DB_DVB_LCNRULE_PANEURO, /**< lcn sort rule of pan Europe */
- DB_DVB_LCNRULE_AUS,
- #ifdef CONFIG_SUPPORT_FAST_SCANNING
- DB_DVB_LCNRULE_M7_FAST,
- #endif
- DB_DVB_LCNRULE_GUARD,
- } EDBLCNRule_t;
- /**< LCN Assign Rule deifne */
- typedef enum
- {
- /**< Assign Program Num of All None LCN services and conflict LCN services following their own Spec */
- DB_DVB_ASSIGN_NONELCN_FOLLOW_SPEC = 0,
- /**< Some customer required this behavior, assign Program Num of All None LCN services and conflict LCN services following the Max LCN Number */
- DB_DVB_ASSIGN_NONELCN_FOLLOW_MAX,
- /**< Assign Program Num of All None LCN services and conflict LCN services from 800 */
- DB_DVB_ASSIGN_NONELCN_FROM_800,
- } EDBLCNAssignRule_t;
- /**< Extend LCN Assign Rule deifne */
- typedef enum
- {
- /**< Assign Program Num of All None LCN services and conflict LCN services combine */
- DB_DVB_ASSIGN_NONELCN_COMBINE = 0,
- /**< Some customer required this behavior, assign Program Num independently within same service type(TV, Radio, Data service) */
- DB_DVB_ASSIGN_NONELCN_SEPARATE,
- } EDBLCNAssignRuleExt_t;
- typedef enum
- {
- DB_DVB_TRD_COUNTRY_MATCHED = 1 << 0,
- DB_DVB_TRD_HAS_PRIMARY = 1 << 1,
- DB_DVB_TRD_HAS_SECONDARY = 1 << 2,
- DB_DVB_TRD_HAS_TERTIARY = 1 << 3,
- } EDBTRDInfo_t;
- /**< TRND(Target Region Name Decriptor) Dictionary define */
- typedef struct _DBTRNDDictionary_t
- {
- struct _DBTRNDDictionary_t *pNext; /**< Pointer to The next TRND */
- UINT8 pTRND[0]; /**< Content of Target Ragion Name Decriptor */
- } DBTRNDDictionary_t, *PDBTRNDDictionary_t;
- /**< structure defined for ASTRA LCN & Ghana LCN processing */
- typedef struct _DBDVBLocator
- {
- UINT16 usONID;
- UINT16 usTSID;
- UINT16 usSrvID;
- }DBDVBLocator_t, *PDBDVBLocator_t;
- typedef struct _DBSingChnLCN_t
- {
- UINT16 usChnListID;
- UINT8 bVisibleFlag;
- UINT8 ucServType; /* loaded by Service descriptor */
- UINT16 usLCN;
- } DBSingChnLCN_t, *PDBSingChnLCN_t;
- typedef struct _DBMultiLCN_t
- {
- UINT32 uiUsrData; /**< this data will be explained by application itself */
- DBDVBLocator_t stLocator;
- DBSingChnLCN_t stChnLCNs[DB_DVB_MAX_CHNLIST_NUM][DB_DVB_MAX_MULTILCN_NUM];
- struct _DBMultiLCN_t *pNextServ;
- } DBMultiLCN_t, *PDBMultiLCN_t;
- typedef struct _DBMultiChnListInfo
- {
- PDBMultiLCN_t pCurPtr; /* iterator for single list traversal */
- PDBMultiLCN_t pDBMultiLCN;
- UINT16 usCurIdx; /* iterator for array traversal */
- UINT16 usValidCnt;
- /**< Notice: Nordig channel list required 8bits but ASTRA chnlist id required 16 bits space */
- UINT8 ucChnListID[DB_DVB_MAX_CHNLIST_NUM];
- UINT8 ucChnListName[DB_DVB_MAX_CHNLIST_NUM][DB_DVB_MAX_CHNLIST_NAME_LEN];
- } DBMultiChnListInfo_t, *PDBMultiChnListInfo;
- /**< LCN conflict list */
- typedef struct _DBLCNConfSet_t
- {
- UINT16 LCNNum; /**< The conflict LCN number */
- UINT8 ProgCount; /**< The count of service which request the same LCN */
- UINT8 ProgType[DB_DVB_MAX_LCN_CONF_PROG]; /**< The type of conflict lcn programe*/
- CDBIHandle_t hProg[DB_DVB_MAX_LCN_CONF_PROG]; /**< The handle of conflict lcn programe, use it to update or get something*/
- UINT8 ProgNIDMatch[DB_DVB_MAX_LCN_CONF_PROG]; /**< Specify this program whether match current country's ONID, used by Italy(Z-Book) only */
- UINT8 ProgSQI[DB_DVB_MAX_LCN_CONF_PROG]; /**< Signal Strength */
- UINT8 ProgSSI[DB_DVB_MAX_LCN_CONF_PROG]; /**< Signal Quality */
- DBTRDCodeInfo_t stTrd[DB_DVB_MAX_LCN_CONF_PROG][DB_DVB_MAX_SRV_TRD]; /**< the service's target region */
- struct _DBLCNConfSet_t *pNextConfSet; /**< Pointer to next LCN conflict set */
- } DBLCNConfSet_t, *PDBLCNConfSet_t;
- /**< Conflict LCN total list */
- typedef struct
- {
- UINT16 ConfCount; /**< The count of conflict lcn programe */
- PDBLCNConfSet_t pLCNConfSet; /**< Just store conflict lcn programe */
- } DBLCNConfInfo_t, *PDBLCNConfInfo_t;
- /**< LCN conflict list */
- typedef struct _DBLCNVariantSet_t
- {
- UINT16 LCNNum; /**< The conflict LCN number */
- UINT8 ProgCount; /**< The count of service which request the same LCN */
- UINT16 hMinTVProg; /**< The one has minimum program number */
- UINT16 hMinRadioProg; /**< The one has minimum program number */
- UINT16 hMinDataProg; /**< The one has minimum program number */
- UINT8 ProgType[DB_DVB_MAX_LCN_CONF_PROG]; /**< The type of conflict lcn programe*/
- UINT16 hProg[DB_DVB_MAX_LCN_CONF_PROG]; /**< The handle of conflict lcn programe, use it to update or get something*/
- UINT16 NID[DB_DVB_MAX_LCN_CONF_PROG]; /**< Network ID for this service */
- struct _DBLCNVariantSet_t *pNextConfSet; /**< Pointer to next LCN conflict set */
- } DBLCNRiksVariantNode_t, *PDBLCNRiksVariantNode_t;
- /**< Regional variants info for those services whihc LCN conflict */
- typedef struct
- {
- UINT16 ConfCount; /**< The count of conflict lcn programe */
- PDBLCNRiksVariantNode_t pLCNRiksVariantSet; /**< Just store conflict lcn programe */
- } DBLCNRiksVariantInfo_t, *PDBLCNRiksVariantInfo_t;
- /**
- * @brief Set LCN process rule.
- *
- * @param eLCNRule Specified LCN Rule.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_SetLCNRule(EDBLCNRule_t eLCNRule);
- /**
- * @brief whether support HD Simulcast LCN swap function.
- *
- * @return TRUE or FALSE.
- */
- bool LCN_SupportHDSimulSwap(void);
- /**
- * @brief Set LCN process rule.
- *
- * @param eAssignLCNRule None LCN service assign Rule follow spec or follow the max LCN.
- * @param eAssingLCNRuleExt Assign number to None LCN service combine or separately.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_SetExtLCNRule(EDBLCNAssignRule_t eAssignLCNRule, EDBLCNAssignRuleExt_t eAssingLCNRuleExt);
- /**
- * @brief Assign LCN to this service.
- *
- * @param hServ service handle.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_AssignLCN(CDBIHandle_t hServ);
- /**
- * @brief Assign a valid Number to None LCN service or the loser of conflict LCN service.
- *
- * @param hServ service handle.
- * @param usCurLCN used by Italy(Z-Book).
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_AssignNonLCN(CDBIHandle_t hServ, UINT16 usCurLCN);
- /**
- * @brief Get all LCN conflict to conflict list.
- *
- * @param pLCNConflictList[out] pointer to LCN conflict List.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_QueryLCNConflict(DBLCNConfInfo_t *pLCNConflictList);
- /**
- * @brief free LCN conflict list.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_FreeLCNConflict(void);
- /**
- * @brief Query all regional variant for Riks TRD.
- *
- * @param pLCNConflictList[out] pointer to regional variants List.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_QueryRiksRegionalVariant(PDBLCNRiksVariantInfo_t pLCNConflictList);
- /**
- * @brief process regional variant for Riks TRD.
- *
- * @param pLCNConflictList[in] pointer to regional variants List.
- *
- * @param usFavNID[in] Faverite region.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_ProcRiksRegionalVariant(PDBLCNRiksVariantInfo_t pLCNConflictList, UINT16 usFavNID);
- /**
- * @brief Auto assign Number to those LCN conflict services.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_AutoAssignConflictLCN(void);
- /**
- * @brief Prejudge the LCN status for all Service.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_PreJudgeLCN(void);
- /**
- * @brief Post judge the LCN status for all Service.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_PostJudgeLCN(void);
- /**
- * @brief update LCN for specify service.
- *
- * @param hServIter service handle.
- * @param usNewLCN New LCN Number.
- * @param bForce Force update to the New LCN Number if true.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_UpdateLCN(CDBIHandle_t hServ, UINT16 usNewLCN, bool bForce);
- /**
- * @brief Process LCN conflict by TRD(Target region descriptor).
- *
- * @param u8RegionDepth region depth
- * @param u8PrimaryCode primary code
- * @param u8SecondayCode seconday code
- * @param u16TertiaryCode tertiary code
- * @note please refer to 300468 about the TRD
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_AssignConflictLCNByTRD(UINT8 u8RegionDepth, UINT8 u8PrimaryCode,
- UINT8 u8SecondayCode, UINT16 u16TertiaryCode);
- /**
- * @brief just create a Target Ragion Dictionary, user can get TargetRagionName with the given region index entry.
- *
- * @param pstTRND The pointer to the TRND(Target Region Name Desriptor).
- * @param ui32TRNDLenThe length of TRND
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_AddTRNDToDictionary(void *pstTRND, UINT32 ui32TRNDLen);
- /**
- * @brief Get TRND Dictionary.
- *
- * @param pTRDDictionary[out] The pointer to the TRND(Target Region Name Desriptor).
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_GetTRNDDictionary(PDBTRNDDictionary_t *pTRDDictionary);
- /**
- * @brief Free TRND Dictionary.
- *
- * @return DB_SUCCESS if succeed, error code otherwise.
- */
- EDBError_t LCN_FreeTRNDDictionary(void);
- EDBError_t LCN_MultiChnList_SetIdName( UINT32 usChnListID, UINT8 *pChnListName, UINT8 uiLen, UINT8 *puiIdx );
- EDBError_t LCN_MultiChnList_SetLCN( UINT32 uiUsrData, PDBSingChnLCN_t pLCN, UINT8 uiIdx );
- EDBError_t LCN_MultiChnList_SetLCNExt(PDBDVBLocator_t pLocator, PDBSingChnLCN_t pLCN, UINT8 uiIdx );
- UINT8 LCN_MultiChnList_GetValidCnt( void );
- EDBError_t LCN_MultiChnList_GetInfo( PDBMultiChnListInfo *pMultiLCNInfo );
- EDBError_t LCN_MultiChnList_GetNextServLCNByChnListID(UINT32 usIdx, PDBDVBLocator_t pLocator, PDBSingChnLCN_t pLCNInfo);
- EDBError_t LCN_FreeMultiChnListInfo(void);
- bool LCN_QueryLCNAllocate( UINT16 usProgNum, EServiceType_t eTvRadioType );
- UINT16 LCN_QueryValidRange();
- bool LCN_QueryListSeparate();
- #ifdef __cplusplus
- }
- #endif
- #endif
|