DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
ap_dbdef.h File Reference

Application database control. More...

#include "techtype.h"
#include "stbsiflt.h"
#include "stbsitab.h"
#include "stbllist.h"
#include "ap_cfg.h"
#include "ap_tmr.h"
#include "ap_dbacc.h"

Go to the source code of this file.

Data Structures

struct  adb_string
 
struct  adb_lnb_rec
 
struct  adb_bat_version_rec
 
struct  adb_satellite_rec
 
struct  adb_lnb_band_rec
 
struct  adb_network_rec
 
struct  adb_pmt_version_rec
 
struct  adb_transport_rec
 
struct  adb_audio_stream_data
 
struct  adb_subtitle_stream_data
 
struct  adb_ttext_stream_data
 
union  adb_stream_data
 
struct  adb_stream_rec
 
struct  adb_event_desc
 
struct  adb_event_rec
 
struct  adb_alt_serv_rec
 
struct  adb_icon_image
 
struct  adb_rct_link_info
 
struct  ADB_GUIDANCE_DESC
 
struct  adb_service_rec
 
struct  adb_crid_record
 
struct  adb_favserv_rec
 
struct  adb_favlist_rec
 
struct  ADB_ALARM_REC
 
struct  ADB_PVR_RECORD_REC
 
struct  ADB_TIMER_REC
 
struct  s_event
 

Macros

#define ADB_LANG_CODE_UNDEF   0x756e64
 
#define ADB_LANG_CODE_QAA   0x716161
 
#define ADB_LANG_CODE_NAR   0x6e6172
 
#define LINKAGE_DTAG   0x4a
 
#define SHORT_EVENT_DTAG   0x4d
 
#define EXTENDED_EVENT_DTAG   0x4e
 
#define COMPONENT_DTAG   0x50
 
#define CONTENT_DTAG   0x54
 
#define PARENTAL_RATING_DTAG   0x55
 
#define PRIVATE_DATA_SPEC_DTAG   0x5f
 
#define CONT_ID_DESC_DTAG   0x76
 
#define FTA_CONTENT_DESC_DTAG   0x7e
 
#define EXTENSION_DTAG   0x7f
 
#define USER_DEFINED_DTAG_0x85   0x85
 
#define USER_DEFINED_DTAG_0x89   0x89
 
#define LINK_TYPE_EVENT   0x0d
 
#define LINK_TYPE_EXT_EVENT   0x0e
 
#define INVALID_FREESAT_SERV_ID   0x8000
 
#define TVA_PROGRAMME_CRID   0x01
 
#define TVA_SERIES_CRID   0x02
 
#define TVA_RECOMMENDATION_CRID   0x03
 
#define UK_PROGRAMME_CRID   0x31
 
#define UK_SERIES_CRID   0x32
 
#define UK_RECOMMENDATION_CRID   0x33
 

Typedefs

typedef struct adb_string ADB_STRING
 
typedef struct adb_lnb_rec ADB_LNB_REC
 
typedef struct adb_bat_version_rec ADB_BAT_VERSION_REC
 
typedef struct adb_satellite_rec ADB_SATELLITE_REC
 
typedef struct adb_lnb_band_rec ADB_LNB_BAND_REC
 
typedef struct adb_network_rec ADB_NETWORK_REC
 
typedef struct adb_pmt_version_rec ADB_PMT_VERSION_REC
 
typedef struct adb_transport_rec ADB_TRANSPORT_REC
 
typedef struct
adb_audio_stream_data 
ADB_AUDIO_STREAM_DATA
 
typedef struct
adb_subtitle_stream_data 
ADB_SUBTITLE_STREAM_DATA
 
typedef struct
adb_ttext_stream_data 
ADB_TTEXT_STREAM_DATA
 
typedef union adb_stream_data ADB_STREAM_DATA
 
typedef struct adb_stream_rec ADB_STREAM_REC
 
typedef struct adb_event_desc ADB_EVENT_DESC
 
typedef struct adb_event_rec ADB_EVENT_REC
 
typedef struct adb_alt_serv_rec ADB_ALT_SERV_REC
 
typedef struct adb_icon_image ADB_IMAGE_ICON
 
typedef struct adb_rct_link_info ADB_RCT_LINK_INFO
 
typedef struct adb_service_rec ADB_SERVICE_REC
 
typedef struct adb_crid_record ADB_CRID_REC
 
typedef struct adb_favserv_rec ADB_FAVSERV_REC
 
typedef struct adb_favlist_rec ADB_FAVLIST_REC
 
typedef struct s_event S_EVENT
 

Enumerations

enum  E_STREAM_MATCH_TYPE {
  STREAM_MATCH_EXACT, STREAM_MATCH_ASPECT, STREAM_MATCH_LANG, STREAM_MATCH_TYPE,
  STREAM_MATCH_NOT_ZERO, STREAM_MATCH_NONE
}
 
enum  E_ICON_TYPE { ICON_TYPE_PNG, ICON_TYPE_JPEG }
 

Functions

void DBDEF_Initialise (void)
 Initialises the database, preparing for it to be accessed.
 
void DBDEF_RequestAccess (void)
 Requests access to the app's database.
 
void DBDEF_ReleaseAccess (void)
 Releases access to the app's database.
 
BOOLEAN DBDEF_LoadDatabase (U8BIT *db_pathname)
 Loads the service database from non-volatile storage and creates the RAM version of this data that will be used by the DVB stack. More...
 
void DBDEF_DeleteAllRecords (void)
 Deletes all records in the database.
 
BOOLEAN DBDEF_SaveDatabase (void)
 
void DBDEF_DeleteRecordsForTunerType (E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite)
 Deletes all network, transport and services records for the given tuner type. More...
 
void DBDEF_DeleteServiceRec (ADB_SERVICE_REC *s_ptr)
 Deletes specified service record. More...
 
U16BIT DBDEF_NumStreamsInList (ADB_STREAM_REC *slist)
 Returns the number of stream records in the given list. More...
 
ADB_STREAM_RECDBDEF_CopyStreamList (ADB_STREAM_REC *slist)
 Creates a copy of a stream list, allocating new memory as required. More...
 
void DBDEF_DeleteStreamList (ADB_STREAM_REC *slist)
 Deletes all records in a service stream list. More...
 
void DBDEF_DeleteAltServList (ADB_ALT_SERV_REC *aslist)
 Deletes all records in a service alternate service list. More...
 
void DBDEF_DeleteRCTLinks (ADB_RCT_LINK_INFO *links)
 Frees the given list of RCT links. More...
 
void DBDEF_DeleteImageIcons (ADB_IMAGE_ICON *icon_list)
 Frees given list of image icons and any associated memory. More...
 
void DBDEF_SortServicesByLcn (void)
 Sort the full service list into ascending logical channel number order.
 
BOOLEAN DBDEF_AllocateLcns (E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN assign_lcns)
 allocates lcns - expects allocated lcn for all services to be 0 More...
 
BOOLEAN DBDEF_AllocateLcnsDefault (E_STB_DP_SIGNAL_TYPE tuner_type)
 
U16BIT DBDEF_GetNumLNBs (void)
 Returns the number of LNB records in the database. More...
 
ADB_LNB_RECDBDEF_AddLNB (E_STB_DP_LNB_TYPE type, ADB_STRING *name)
 Add an LNB record to the database. More...
 
BOOLEAN DBDEF_SetLNBPower (ADB_LNB_REC *lnb, E_STB_DP_LNB_POWER power)
 Sets the LNB power setting. More...
 
BOOLEAN DBDEF_SetLNB22k (ADB_LNB_REC *lnb, BOOLEAN is_22k)
 Sets the LNB 22k setting. More...
 
BOOLEAN DBDEF_SetLNB12V (ADB_LNB_REC *lnb, BOOLEAN is_12v)
 Sets the LNB 12V setting. More...
 
BOOLEAN DBDEF_SetLNBPulsePosition (ADB_LNB_REC *lnb, BOOLEAN is_pulse_posn)
 Sets the LNB pulse position setting. More...
 
BOOLEAN DBDEF_SetLNBDiSEqCPosition (ADB_LNB_REC *lnb, BOOLEAN is_diseqc_posn)
 Sets the LNB DiSEqC position setting. More...
 
BOOLEAN DBDEF_SetLNBDiSEqCTone (ADB_LNB_REC *lnb, E_STB_DP_DISEQC_TONE diseqc_tone)
 Sets the LNB DiSEqC tone setting. More...
 
BOOLEAN DBDEF_SetLNBCSwitch (ADB_LNB_REC *lnb, E_STB_DP_DISEQC_CSWITCH cswitch)
 Sets the LNB committed switch setting. More...
 
BOOLEAN DBDEF_SetLNBUSwitch (ADB_LNB_REC *lnb, U8BIT uswitch)
 Sets the LNB uncommitted switch setting. More...
 
BOOLEAN DBDEF_SetLNBSmatv (ADB_LNB_REC *lnb, BOOLEAN is_smatv)
 Sets the LNB SMATV setting. More...
 
BOOLEAN DBDEF_SetLNBRepeats (ADB_LNB_REC *lnb, U8BIT repeats)
 Sets the LNB message repeat setting in the range 0 to 3. More...
 
BOOLEAN DBDEF_SetLNBUnicable (ADB_LNB_REC *lnb, U32BIT inter_freq, U8BIT chan)
 Sets the LNB Unicable settings. More...
 
ADB_LNB_RECDBDEF_GetNextLNBRec (ADB_LNB_REC *lnb_ptr)
 Returns the next LNB record after the one given. If the argument is NULL then the first record is returned. More...
 
U16BIT DBDEF_GetNumSatellites (void)
 Returns the number of satellite records in the database. More...
 
ADB_SATELLITE_RECDBDEF_AddSatelliteRec (ADB_STRING *name_str, U16BIT dish_pos, U16BIT long_pos, BOOLEAN east_west, ADB_LNB_REC *associated_lnb)
 Add a satellite record to the database. More...
 
ADB_SATELLITE_RECDBDEF_GetNextSatelliteRec (ADB_SATELLITE_REC *sat_ptr)
 Returns the next satellite record after the one given. If the argument is NULL then the first record is returned. More...
 
U16BIT DBDEF_GetNumLNBBands (void)
 Returns the number of LNB band records in the database. More...
 
ADB_LNB_BAND_RECDBDEF_AddLNBBandRec (S_STB_DP_LNB_BAND *band_parameters, ADB_LNB_REC *associated_lnb)
 Add an LNB band record to the database. More...
 
ADB_LNB_BAND_RECDBDEF_GetNextLNBBandRec (ADB_LNB_BAND_REC *band_ptr)
 Returns the next LNB band record after the one given. If the argument is NULL then the first record is returned. More...
 
void DBDEF_DeleteLNBBandRec (ADB_LNB_BAND_REC *band_ptr)
 Deletes an LNB band record from the database. More...
 
U16BIT DBDEF_GetNumNetworks (void)
 Returns the number of networks in ther service database. More...
 
ADB_NETWORK_RECDBDEF_AddNetworkRec (U16BIT net_id, ADB_SATELLITE_REC *satellite)
 Adds a new network record to the database with the given network ID. More...
 
void DBDEF_DeleteNetworkRec (ADB_NETWORK_REC *n_ptr)
 Deletes specified network record. More...
 
void DBDEF_SetNetworkName (ADB_NETWORK_REC *n_ptr, U8BIT *name)
 Set or change the name of the given network. More...
 
ADB_NETWORK_RECDBDEF_FindNetworkRec (U16BIT net_id, ADB_SATELLITE_REC *satellite)
 Finds the network with the given network ID. More...
 
ADB_NETWORK_RECDBDEF_GetNextNetworkRec (ADB_NETWORK_REC *n_ptr)
 Returns the network following the one given. If the argument is NULL then the first network will be returned. More...
 
U16BIT DBDEF_GetNumTransports (void)
 Returns the number of transports in ther service database. More...
 
ADB_TRANSPORT_RECDBDEF_GetNextTransportRec (ADB_TRANSPORT_REC *t_ptr)
 Returns the transport following the one given. If the argument is NULL then the first transport will be returned. More...
 
ADB_TRANSPORT_RECDBDEF_AddTerrestrialTransportRec (U32BIT freq_hz, U8BIT plp_id, ADB_NETWORK_REC *network)
 Adds a terrestrial transport record with the given frequency and PLP id. More...
 
ADB_TRANSPORT_RECDBDEF_FindTerrestrialTransportRec (U32BIT freq_hz, U8BIT plp_id)
 Find the terrestrial transport record in the database matching the given params. More...
 
ADB_TRANSPORT_RECDBDEF_AddCableTransportRec (U32BIT freq_hz, U32BIT symbol_rate, ADB_NETWORK_REC *network)
 Adds a cable transport record with the given frequency and symbol rate. More...
 
ADB_TRANSPORT_RECDBDEF_FindCableTransportRec (U32BIT freq_hz, U32BIT symbol_rate)
 Find the cable transport record in the database matching the given params. More...
 
void DBDEF_SetCableTransportSymbolRate (ADB_TRANSPORT_REC *t_ptr, U16BIT symbol_rate)
 
void DBDEF_SetCableTransportMode (ADB_TRANSPORT_REC *t_ptr, E_STB_DP_CMODE cmode)
 
ADB_TRANSPORT_RECDBDEF_AddSatTransportRec (U32BIT freq_hz, U16BIT symbol_rate, E_STB_DP_POLARITY polarity, BOOLEAN dvb_s2, E_STB_DP_MODULATION modulation, ADB_NETWORK_REC *network)
 Adds a satellite transport record with the given frequency, symbol rate and polarity. More...
 
ADB_TRANSPORT_RECDBDEF_FindSatTransportRec (U32BIT freq_hz, U16BIT symbol_rate, E_STB_DP_POLARITY polarity, BOOLEAN dvb_s2, E_STB_DP_MODULATION modulation, void *satellite)
 Find the satellite transport record in the database matching the given params. More...
 
void DBDEF_SetSatTransportTuningParams (ADB_TRANSPORT_REC *t_ptr, U32BIT freq_hz, U16BIT symbol_rate, E_STB_DP_POLARITY polarity, BOOLEAN dvb_s2, E_STB_DP_MODULATION modulation, ADB_NETWORK_REC *network)
 Sets the tuning parameters for an existing satellite transport. More...
 
ADB_TRANSPORT_RECDBDEF_FindTransportRecByIds (ADB_TRANSPORT_REC *transp, U32BIT net_id, U32BIT onet_id, U32BIT tran_id)
 Find a transport record matching the given set of IDs, starting from the given transport. More...
 
void DBDEF_SetTransportTransportId (ADB_TRANSPORT_REC *t_ptr, U16BIT tran_id)
 Sets the transport ID of the given transport. More...
 
void DBDEF_SetTransportOrigNetworkId (ADB_TRANSPORT_REC *t_ptr, U16BIT orig_net_id)
 Sets the original network ID of the given transport. More...
 
void DBDEF_DeleteTransportRec (ADB_TRANSPORT_REC *t_ptr)
 Deletes the given transport from the service database. More...
 
void DBDEF_ClearTableVersionHistory (ADB_TRANSPORT_REC *t_ptr)
 Clears the version histories stored in the transport records.
 
U16BIT DBDEF_GetNumServices (void)
 Returns the total number of services. More...
 
ADB_SERVICE_RECDBDEF_GetNextServiceRec (ADB_SERVICE_REC *s_ptr)
 Returns the service after the one given. If NULL is passed then the first service in the list is returned. More...
 
ADB_SERVICE_RECDBDEF_GetPrevServiceRec (ADB_SERVICE_REC *s_ptr)
 Returns the service before the one given. If NULL is passed then the last service in the list is returned. More...
 
ADB_SERVICE_RECDBDEF_NewServiceRec (U16BIT serv_id, ADB_TRANSPORT_REC *t_ptr, BOOLEAN prepend)
 Adds a new service record to the service database with the given service ID and parent transport. With prepend set to FALSE, same as DBDEF_AddServiceRec. More...
 
ADB_SERVICE_RECDBDEF_AddServiceRec (U16BIT serv_id, ADB_TRANSPORT_REC *t_ptr)
 Adds a new service record to the service database with the given service ID and parent transport. More...
 
ADB_SERVICE_RECDBDEF_CopyServiceRec (ADB_SERVICE_REC *orig_serv)
 Creates a copy of the given service, copying the service's attributes, e.g. service name, scrambled, locked, hidde, etc, but not the runtime specific data such as the stream list or event schedule data. More...
 
BOOLEAN DBDEF_SetServiceName (ADB_SERVICE_REC *s_ptr, U8BIT *name)
 Set or change the name of a service. More...
 
BOOLEAN DBDEF_SetServiceShortName (ADB_SERVICE_REC *s_ptr, U8BIT *name)
 Set or change the short name of a service. More...
 
BOOLEAN DBDEF_SetServiceProviderName (ADB_SERVICE_REC *s_ptr, U8BIT *name)
 Set or change the name of a service's provider. More...
 
BOOLEAN DBDEF_SetServiceType (ADB_SERVICE_REC *s_ptr, ADB_SERVICE_TYPE serv_type)
 Sets the service type for the given service record. More...
 
void DBDEF_SaveServiceEventSchedule (ADB_SERVICE_REC *s_ptr)
 Saves the event schedule of a service to the service database. More...
 
ADB_SERVICE_RECDBDEF_GetNextServiceOnTransport (ADB_SERVICE_REC *s_ptr, ADB_TRANSPORT_REC *t_ptr)
 Find the next service following the given service that's on the given transport. More...
 
ADB_SERVICE_RECDBDEF_FindServiceRecByIds (ADB_SERVICE_REC *servp, U32BIT net_id, U32BIT onet_id, U32BIT tran_id, U32BIT serv_id)
 Search for a service with the given IDs. More...
 
ADB_SERVICE_RECDBDEF_FindServiceRecByLcn (U16BIT lcn, ADB_TRANSPORT_REC *t_ptr, BOOLEAN allocated_lcn)
 Find the service with the given LCN, and optionally on the given transport. More...
 
ADB_SERVICE_RECDBDEF_FindServiceRecByFreesatId (ADB_SERVICE_REC *servp, U16BIT freesat_id)
 Search for a service with the given Freesat ID. More...
 
U16BIT DBDEF_GetReqdAudioPid (ADB_SERVICE_REC *s_ptr, E_STB_DP_AUDIO_MODE *audio_mode, ADB_STREAM_TYPE *audio_type)
 Gets the appropriate audio pid - looks first for the pid matching exactly the required audio settings in the database, then for the pid matching the default language, then the first audip pid in the stream list. If no pid found the returned pid value will be 0. More...
 
U16BIT DBDEF_GetReqdADPid (ADB_SERVICE_REC *s_ptr, E_STB_DP_AUDIO_MODE *ad_mode, ADB_STREAM_TYPE *ad_type, BOOLEAN *broadcast_mix)
 Gets the appropriate audio description pid - looks first for the pid matching exactly the required audio settings in the database, then for the pid matching the default language, then the first audip pid in the stream list. If no pid found the returned pid value will be 0. More...
 
E_STREAM_MATCH_TYPE DBDEF_GetReqdTtextPid (ADB_SERVICE_REC *s_ptr, BOOLEAN for_subtitles, U16BIT *pid_ptr, U8BIT *magazine, U8BIT *page)
 Gets the appropriate teletext pid - looks first for the params matching exactly the required teletext settings in the database, then for the pid matching the default language, then the first teletext stream in the stream list. If no teletext found the returned pid will be 0. More...
 
E_STREAM_MATCH_TYPE DBDEF_GetReqdSubtitleParams (ADB_SERVICE_REC *s_ptr, U16BIT *pid_ptr, U16BIT *cpage_ptr, U16BIT *apage_ptr)
 Gets the appropriate subtitle pid and page ids - looks first for the params matching exactly the required subtitle settings in the database, then for the pid matching the default language, then the first subtitle stream in the stream list. If no subtitles found the returned pid will be 0. More...
 
U16BIT DBDEF_GetReqdVideoPid (ADB_SERVICE_REC *s_ptr, ADB_STREAM_TYPE *video_type)
 Returns the video pid and type that should be used for the given service from the list of video streams available. The "best one" is based on HD being better than SD and uses the priorities from the Nordig spec. More...
 
ADB_STRINGDBDEF_GetServiceName (ADB_SERVICE_REC *s_ptr, BOOLEAN short_name, BOOLEAN pref_name)
 Returns a pointer to the service name, taking into account perferred names and short names, if available. More...
 
ADB_STRINGDBDEF_GetServiceProviderName (ADB_SERVICE_REC *s_ptr)
 Returns a pointer to the service provider name. More...
 
BOOLEAN DBDEF_AddAnalogService (void)
 Adds an analogue service, transport and, if necessary, network to the database based on the current tuning parameters in the decode path. More...
 
void DBDEF_SetAnalogServiceName (ADB_SERVICE_REC *s_ptr, U8BIT *new_name, U8BIT new_len)
 Updates analog service names - ASSUMES NORMAL ASCII CODED. More...
 
void DBDEF_SetServicePmtPid (ADB_SERVICE_REC *s_ptr, U16BIT pmt_pid)
 Updates the pmt pid. More...
 
U16BIT DBDEF_GetServicePmtPid (ADB_SERVICE_REC *s_ptr)
 gets the PMT PID associated with the service More...
 
void DBDEF_SetServiceFavGroups (ADB_SERVICE_REC *s_ptr, U8BIT groups)
 Sets the favourite groups for a service. More...
 
ADB_EVENT_RECDBDEF_FindScheduleEventById (ADB_SERVICE_REC *s_ptr, U16BIT event_id)
 Find an event for a service from its event_id. More...
 
ADB_EVENT_DESCDBDEF_FindEventDescriptor (ADB_EVENT_DESC *start_desc, U8BIT desc_tag, U32BIT private_data_specifier)
 Searches a descriptor list for the first descriptor with the given descriptor tag. More...
 
U8BIT * DBDEF_GetEventName (ADB_EVENT_REC *e_ptr)
 Returns the name of the event as a UTF-8 string in the currently selected language. The returned string should be freed using STB_ReleaseUnicodeString. More...
 
U8BIT * DBDEF_GetEventDescription (ADB_EVENT_REC *e_ptr)
 Returns the short event description text of the event as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString. More...
 
U8BIT * DBDEF_GetEventExtendedDescription (ADB_EVENT_REC *e_ptr)
 Returns the extended event description text of the event as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString. More...
 
ADB_EVENT_ITEMIZED_INFODBDEF_GetEventItemizedDescription (ADB_EVENT_REC *e_ptr, U16BIT *num_items_ptr)
 Returns the items of extended event descriptor as item descriptor and item itself. More...
 
U8BIT * DBDEF_GetEventGuidance (ADB_EVENT_REC *e_ptr, ADB_SERVICE_REC *s_ptr, U8BIT *type, U8BIT *mode)
 Returns the guidance text for an event, either from the event itself or the event's service, as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString. More...
 
U8BIT * DBDEF_GetServiceGuidanceData (ADB_SERVICE_REC *s_ptr, U8BIT *type, U8BIT *mode)
 Returns the guidance text for the service, as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString. More...
 
U8BIT * DBDEF_GetServiceGuidance (ADB_SERVICE_REC *s_ptr)
 Returns the guidance text for the service, as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString. More...
 
U8BIT DBDEF_GetEventParentalAge (ADB_EVENT_REC *e_ptr)
 Returns the parental age value for the given event. More...
 
BOOLEAN DBDEF_GetEventAudioDescriptionFlag (ADB_EVENT_REC *e_ptr)
 Returns whether audio description is signalled as being available for the given event. More...
 
BOOLEAN DBDEF_GetEventHDLinkageInfo (ADB_EVENT_REC *e_ptr, BOOLEAN verify_event, BOOLEAN only_simulcast, ADB_SERVICE_REC **hd_serv_ptr, ADB_EVENT_REC **hd_event_ptr)
 Returns whether there's an HD event linked to the SD event and returns the info for it. The DVB info is checked to ensure it relates to a known service. More...
 
U8BIT DBDEF_GetEventComponentList (ADB_EVENT_REC *e_ptr, ADB_EVENT_COMPONENT_INFO **component_list)
 Retrieves a list of components associated with the specified event, as described by component descriptors in the EIT. More...
 
BOOLEAN DBDEF_GetEventSubtitlesAvailFlag (ADB_EVENT_REC *e_ptr)
 Returns whether DVB subtitles are signalled as being available for the given event. More...
 
ADB_EVENT_CONTENT DBDEF_GetEventGenre (ADB_EVENT_REC *e_ptr, ADB_SERVICE_REC *s_ptr)
 Returns the genre of an event. More...
 
U8BIT * DBDEF_GetEventContentData (ADB_EVENT_REC *e_ptr, U8BIT *p_len)
 Returns the level 1 and 2 values for all content identifiers for the given event. More...
 
U8BIT * DBDEF_GetEventCrid (ADB_SERVICE_REC *serv_ptr, ADB_EVENT_REC *e_ptr, U8BIT crid_type, U8BIT index)
 Returns the full CRID of the type given for the given event. More...
 
U8BIT DBDEF_NumberOfCridsOfType (ADB_EVENT_REC *e_ptr, U8BIT crid_type)
 Returns the number of CRIDs of the given type for the event. More...
 
U8BIT * DBDEF_GetFullCrid (ADB_SERVICE_REC *serv_ptr, U8BIT *event_str)
 Returns the full CRID for the given CRID string The returned string should be freed using STB_AppFreeMemory. More...
 
U8BIT * DBDEF_GetServiceDefaultAuthority (ADB_SERVICE_REC *s_ptr)
 Returns a copy of the default authority CRID string for the given service. This string will be returned as broadcast and should be freed using STB_AppFreMemory. More...
 
void DBDEF_DeleteEventList (ADB_EVENT_REC *elist)
 Deletes all events in the given list. More...
 
void DBDEF_SetTunedNetwork (U8BIT path, ADB_NETWORK_REC *n_ptr)
 sets the currently tuned network More...
 
ADB_NETWORK_RECDBDEF_GetTunedNetwork (U8BIT path)
 gets the currently tuned network More...
 
void DBDEF_SetTunedTransport (U8BIT path, ADB_TRANSPORT_REC *t_ptr)
 sets the currently tuned transport More...
 
ADB_TRANSPORT_RECDBDEF_GetTunedTransport (U8BIT path)
 gets the currently tuned transport More...
 
void DBDEF_SetTunedService (U8BIT path, ADB_SERVICE_REC *s_ptr)
 Sets the currently tuned service. More...
 
ADB_SERVICE_RECDBDEF_GetTunedService (U8BIT path)
 Returns the currently tuned service on the given path. More...
 
void DBDEF_SetTextLang (U8BIT *lang_ids)
 sets current text lang More...
 
U8BIT * DBDEF_GetTextLang (void)
 returns array of current text langs More...
 
void DBDEF_SetSecondaryTextLang (U8BIT *lang_ids)
 sets secondary text lang More...
 
U8BIT * DBDEF_GetSecondaryTextLang (void)
 returns array of secondary text langs More...
 
void DBDEF_SetAudioLang (U8BIT *lang_ids)
 sets current audio lang More...
 
U8BIT * DBDEF_GetAudioLang (void)
 returns current audio lang More...
 
U8BIT * DBDEF_GetSecondaryAudioLang (void)
 returns current secondary audio lang More...
 
void DBDEF_SetSecondaryAudioLang (U8BIT *lang_ids)
 sets the secondary audio lang More...
 
void DBDEF_TidyDatabaseAfterSearch (E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite, BOOLEAN search_completed, BOOLEAN manual)
 Calls any country and tuner type specific function to tidy up the database following a search, such as removing duplicate services, etc. More...
 
void DBDEF_TidyDatabaseNordig (E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN search_completed, BOOLEAN manual)
 Iterates through all the services following a search search to see whether any need to be deleted based on the rules for that country. More...
 
void DBDEF_TidyDatabaseUK (E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN search_completed, BOOLEAN manual)
 Iterates through all the services following a search search to see whether any need to be deleted based on the rules for that country. More...
 
void DBDEF_TidyDatabaseSatUK (E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN search_completed, BOOLEAN manual)
 Iterates through all the services following a search search to see whether any need to be deleted based on the rules for that country. More...
 
void DBDEF_TidyDatabaseDefault (E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN search_completed, BOOLEAN manual)
 Iterates through all the services following a search search to see whether any need to be deleted based on the rules for that country. More...
 
void DBDEF_RemoveEmptyTransports (E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite)
 Delete all transport records that don't have any services. More...
 
void DBDEF_DeleteLinkageDescripterArray (SI_LINKAGE_DESC_ENTRY *list_ptr)
 
ADB_CRID_RECDBDEF_AddCridRecord (U8BIT *crid, BOOLEAN series, BOOLEAN recommended, BOOLEAN radio_service)
 Creates a CRID record and adds it to the database. More...
 
void DBDEF_SetCridDateTime (ADB_CRID_REC *c_ptr, U32DHMS date_time)
 Sets the date and time fields in the crid record. More...
 
void DBDEF_SetCridService (ADB_CRID_REC *c_ptr, U16BIT serv_id)
 Sets the service ID in the crid record. More...
 
void DBDEF_SetCridProgrammeName (ADB_CRID_REC *c_ptr, U8BIT *prog_name)
 Sets the programme name field of the given CRID record. More...
 
void DBDEF_UpdateCridEitDate (ADB_CRID_REC *c_ptr)
 Updates the stored EIT date of this CRID with the current GMT date. More...
 
void DBDEF_DeleteCridRecord (ADB_CRID_REC *c_ptr)
 Deletes the given CRID record from the database. More...
 
U16BIT DBDEF_GetNumCridRecords (void)
 Returns the number of CRID records in the database. More...
 
ADB_CRID_RECDBDEF_GetNextCridRecord (ADB_CRID_REC *c_ptr)
 Returns the next CRID record after the one specified. If the record specified is NULL then the first record is returned. More...
 
BOOLEAN DBDEF_IsValidCridRecord (ADB_CRID_REC *c_ptr)
 Checks whether the given crid record is in the list of valid crid records. More...
 
U16BIT DBDEF_GetNumFavouriteLists (void)
 Returns the number of favourite lists. More...
 
ADB_FAVLIST_RECDBDEF_AddFavouriteList (U8BIT list_id, U8BIT *name, U32BIT user_data, S16BIT index)
 Creates a new favourite list and adds it to the list of favourite lists. Creation of the new list will fail if a list_id can't be found for it, or memory allocation fails. More...
 
ADB_FAVLIST_RECDBDEF_GetNextFavouriteList (ADB_FAVLIST_REC *fav_list)
 Returns the favourite list following the given item. More...
 
ADB_FAVLIST_RECDBDEF_FindFavouriteList (U8BIT list_id)
 Return the favourite list with the given list id. More...
 
void DBDEF_SetFavouriteListUserData (ADB_FAVLIST_REC *fav_list, U32BIT user_data)
 Saves the given user data with a favourite list. More...
 
void DBDEF_MoveFavouriteListTo (ADB_FAVLIST_REC *fav_list, S16BIT index)
 Changes the order of the favourite lists by moving the given list to the given position. More...
 
void DBDEF_DeleteFavouriteList (ADB_FAVLIST_REC *fav_list)
 Deletes the given favourite list. More...
 
U16BIT DBDEF_GetNumServicesInFavouriteList (ADB_FAVLIST_REC *fav_list)
 Returns the number of services in the given favourite list. More...
 
ADB_FAVSERV_RECDBDEF_AddServiceToFavouriteList (ADB_FAVLIST_REC *fav_list, ADB_SERVICE_REC *serv_ptr, S16BIT index)
 Adds a new service to the given favourite list at the given position. More...
 
ADB_FAVSERV_RECDBDEF_FindServiceInFavouriteList (ADB_FAVLIST_REC *fav_list, void *serv_ptr)
 Returns the ADB_FAVSERV_REC from the given favourite list for the given service. More...
 
ADB_FAVSERV_RECDBDEF_GetNextServiceFromFavouriteList (ADB_FAVLIST_REC *fav_list, ADB_FAVSERV_REC *fav_serv)
 Returns the next favourite list service record. More...
 
ADB_FAVSERV_RECDBDEF_GetPrevServiceFromFavouriteList (ADB_FAVLIST_REC *fav_list, ADB_FAVSERV_REC *fav_serv)
 Returns the previous favourite list service record. More...
 
void DBDEF_MoveFavouriteListServiceTo (ADB_FAVLIST_REC *fav_list, ADB_FAVSERV_REC *fav_serv, S16BIT index)
 Changes the order of the services in the favourite list by moving the given service to the given position. More...
 
void DBDEF_DeleteServiceFromFavouriteList (ADB_FAVLIST_REC *fav_list, ADB_FAVSERV_REC *fav_serv)
 Delete the given service from the given favourite list. More...
 
void DBDEF_DeleteAllServicesFromFavouriteList (ADB_FAVLIST_REC *fav_list)
 Delete the all services from the given favourite list. More...
 
void DBDEF_SetFavouriteListName (ADB_FAVLIST_REC *f_ptr, U8BIT *name)
 Set or change the name of the given favourite list. More...
 
BOOLEAN DBDEF_ServiceForTunerType (ADB_SERVICE_REC *s_ptr, E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite)
 Checks whether the given service is a terrestrial, cable or satellite service, and optionally check whether it's on a particular satellite. More...
 
BOOLEAN DBDEF_TransportForTunerType (ADB_TRANSPORT_REC *t_ptr, E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite)
 Checks whether the given transport is a terrestrial, cable or satellite transport, and optionally check whether it's on a particular satellite. More...
 
ADB_TIMER_RECDBDEF_AddTimerRec (BOOLEAN store_in_nvm)
 Creates a new timer record in the database, assigning it a unique handle. More...
 
ADB_TIMER_RECDBDEF_FindTimerRec (U32BIT handle)
 Returns the timer record with the given timer handle. More...
 
ADB_TIMER_RECDBDEF_GetNextTimerRec (ADB_TIMER_REC *timer_ptr)
 Returns the next timer record after the one given. If the argument is NULL then the first record is returned. More...
 
void DBDEF_SortTimers (BOOLEAN date_time_order)
 Sorts timer list into date/time or alphabetical order. More...
 
void DBDEF_DeleteTimerRec (ADB_TIMER_REC *timer)
 Deletes the given timer from the database. More...
 
U16BIT DBDEF_GetNumProfiles (void)
 Returns the number of network profiles.
 
U16BIT DBDEF_GetProfileList (void ***profile_list, U16BIT *active_profile)
 Gets a list of the available network profiles. More...
 
void DBDEF_ReleaseProfileList (void **profile_list, U16BIT num_profiles)
 Frees a profile list returned by DBDEF_GetProfileList. More...
 
BOOLEAN DBDEF_IsActiveProfile (ADB_NETWORK_REC *profile)
 Is the given profile the currently active profile? More...
 
ADB_PROFILE_TYPE DBDEF_GetCurrentProfileType (void)
 Returns the current profile type. More...
 
void DBDEF_SelectBroadcastProfile (void)
 Sets the broadcast profile type for for all network, transport and service record accesses.
 
void DBDEF_PushBroadcastProfile (void)
 Saves the current profile and any related data so that it can restored using DBDEF_PopProfile(), and sets the broadcast profile type for for all network, transport and service record accesses.
 
void DBDEF_PopProfile (void)
 Restores a previously pushed profile.
 
BOOLEAN DBDEF_ServiceInProfile (ADB_SERVICE_REC *s_ptr)
 Checks whether the given service is valid for the current profile. There may be multiple CI+ profiles and so data related to the CAM is also checked. More...
 
BOOLEAN DBDEF_TransportInProfile (ADB_TRANSPORT_REC *t_ptr)
 Checks whether the given transport is valid for the current profile. There may be multiple CI+ profiles and so data related to the CAM is also checked. More...
 
BOOLEAN DBDEF_NetworkInProfile (ADB_NETWORK_REC *n_ptr)
 Checks whether the given network is valid for the current profile. There may be multiple CI+ profiles and so data related to the CAM is also checked. More...
 
ADB_NETWORK_RECDBDEF_FindOrAddPrivateNetwork (void *satellite)
 Find or add a private network, assigning an unused private network ID. More...
 
ADB_STRINGDBDEF_MakeString (U32BIT lang_code, U8BIT *str_ptr, U16BIT nbytes)
 Creates an ADB_STRING, copying the given data into it. If the string passed in is NULL or the number of bytes is 0, then no string will be created. More...
 
ADB_STRINGDBDEF_CopyString (ADB_STRING *src_str)
 Creates a copy of the given ADB_STRING. More...
 
ADB_STRINGDBDEF_ConcatSIString (ADB_STRING *str1, SI_STRING_DESC *str2)
 Concatenates an SI_STRING_DESC string to the end of an ADB_STRING string, removing any terminating '\0' chars from the first string, and returns a new string. More...
 
void DBDEF_ReleaseString (ADB_STRING *string)
 Releases an ADB_STRING. More...
 

Detailed Description

Application database control.

Date
March 2003

Function Documentation

BOOLEAN DBDEF_AddAnalogService ( void  )

Adds an analogue service, transport and, if necessary, network to the database based on the current tuning parameters in the decode path.

Returns
TRUE if new service record successfully created
ADB_TRANSPORT_REC* DBDEF_AddCableTransportRec ( U32BIT  freq_hz,
U32BIT  symbol_rate,
ADB_NETWORK_REC network 
)

Adds a cable transport record with the given frequency and symbol rate.

Parameters
freq_hzfrequency in Hz
symbol_ratesymbol rate
networknetwork the transport is on
Returns
pointer to the new transport record or NULL if not created
ADB_CRID_REC* DBDEF_AddCridRecord ( U8BIT *  crid,
BOOLEAN  series,
BOOLEAN  recommended,
BOOLEAN  radio_service 
)

Creates a CRID record and adds it to the database.

Parameters
cridCRID string
seriesTRUE if this is a series CRID
recommendedTRUE if this is a recommended programme CRID
radio_serviceTRUE if this CRID is for a radio service, TV otherwise
Returns
pointer to the created CRID record
ADB_FAVLIST_REC* DBDEF_AddFavouriteList ( U8BIT  list_id,
U8BIT *  name,
U32BIT  user_data,
S16BIT  index 
)

Creates a new favourite list and adds it to the list of favourite lists. Creation of the new list will fail if a list_id can't be found for it, or memory allocation fails.

Parameters
list_idid to be given to the list, should be passed as 0 to have an id assigned. If an id is supplied and a list already exists with that id then no list will be created.
namename to be given to the list, call be NULL
user_datauser defined valueto be stored in the list,
indexwhere to add the new list into the existing lists, 0 = at start, negative = at end, else 0 based index
Returns
pointer to new favourite list, or NULL on failure
Parameters
list_idid to be given to the list, should be passed as 0 to have an id assigned. If an id is supplied and a list already exists with that id then no list will be created.
namename to be given to the list, call be NULL
user_datauser defined value to be stored in the list,
indexwhere to add the new list into the existing lists, 0 = at start, negative = at end, else 0 based index
Returns
pointer to new favourite list, or NULL on failure
ADB_LNB_REC* DBDEF_AddLNB ( E_STB_DP_LNB_TYPE  type,
ADB_STRING name 
)

Add an LNB record to the database.

Parameters
typesingle, universal, unicable or used defined
nameLNB name, NULL for no name
Returns
pointer to the new LNB record or NULL if not created
ADB_LNB_BAND_REC* DBDEF_AddLNBBandRec ( S_STB_DP_LNB_BAND band_parameters,
ADB_LNB_REC associated_lnb 
)

Add an LNB band record to the database.

Parameters
band_parametersStructure describing the band and the expected LNB behaviour.
associated_lnbLNB record the band record is associated with.
Returns
pointer to the new LNB band record or NULL if not created
ADB_NETWORK_REC* DBDEF_AddNetworkRec ( U16BIT  net_id,
ADB_SATELLITE_REC satellite 
)

Adds a new network record to the database with the given network ID.

Parameters
net_idnetwork ID
satellitesatellite that contains the network, can be NULL
Returns
pointer to new network record
ADB_SATELLITE_REC* DBDEF_AddSatelliteRec ( ADB_STRING name_str,
U16BIT  dish_pos,
U16BIT  long_pos,
BOOLEAN  east_west,
ADB_LNB_REC associated_lnb 
)

Add a satellite record to the database.

Parameters
name_strsatellite name
dish_pos
long_posposition in 1/10ths of a degree
east_westTRUE=east, FALSE=west
associated_lnbLNB record the satellite record is associated with
Returns
pointer to the new satellite record or NULL if not created
ADB_TRANSPORT_REC* DBDEF_AddSatTransportRec ( U32BIT  freq_hz,
U16BIT  symbol_rate,
E_STB_DP_POLARITY  polarity,
BOOLEAN  dvb_s2,
E_STB_DP_MODULATION  modulation,
ADB_NETWORK_REC network 
)

Adds a satellite transport record with the given frequency, symbol rate and polarity.

Parameters
freq_hzfrequency in Hz
symbol_ratesymbol rate
polaritypolarity
dvb_s2TRUE for DVB-S2
modulationmodulation type
networknetwork the transport is on
Returns
pointer to the new transport record or NULL if not created
ADB_SERVICE_REC* DBDEF_AddServiceRec ( U16BIT  serv_id,
ADB_TRANSPORT_REC t_ptr 
)

Adds a new service record to the service database with the given service ID and parent transport.

Parameters
serv_idservice ID for the new service
t_ptrparent transport for the new service
Returns
pointer to the new service, or NULL if the creation fails
ADB_FAVSERV_REC* DBDEF_AddServiceToFavouriteList ( ADB_FAVLIST_REC fav_list,
ADB_SERVICE_REC serv_ptr,
S16BIT  index 
)

Adds a new service to the given favourite list at the given position.

Parameters
fav_listlist service is to be added to
serv_ptrservice to be added to the list
indexposition to add the service in the list, 0 = at start, negative = at end, any other value is the position
Returns
new favourite service record, or NULL on failure
ADB_TRANSPORT_REC* DBDEF_AddTerrestrialTransportRec ( U32BIT  freq_hz,
U8BIT  plp_id,
ADB_NETWORK_REC network 
)

Adds a terrestrial transport record with the given frequency and PLP id.

Parameters
freq_hzfrequency in Hz
plp_idPLP id for T2, pass 0 for T
networknetwork the transport is on
Returns
pointer to the new transport record or NULL if not created
ADB_TIMER_REC* DBDEF_AddTimerRec ( BOOLEAN  store_in_nvm)

Creates a new timer record in the database, assigning it a unique handle.

Parameters
store_in_nvmsave the timer in non-volatile memory
Returns
pointer to the new timer, or NULL on failure
BOOLEAN DBDEF_AllocateLcns ( E_STB_DP_SIGNAL_TYPE  tuner_type,
BOOLEAN  assign_lcns 
)

allocates lcns - expects allocated lcn for all services to be 0

Parameters
assign_lcns- if set to FALSE the LCNs assigned to the services as a result of running this function will be reset at the end.
use_target_region- TRUE if the target region info is to be used when services with duplicate LCNs are encountered.
Returns
BOOLEAN - TRUE if more than one service requires the same LCN
ADB_STRING* DBDEF_ConcatSIString ( ADB_STRING str1,
SI_STRING_DESC str2 
)

Concatenates an SI_STRING_DESC string to the end of an ADB_STRING string, removing any terminating '\0' chars from the first string, and returns a new string.

Parameters
str1string 1
str2string 2
Returns
new ADB_STRING containing the contents of both strings
ADB_SERVICE_REC* DBDEF_CopyServiceRec ( ADB_SERVICE_REC orig_serv)

Creates a copy of the given service, copying the service's attributes, e.g. service name, scrambled, locked, hidde, etc, but not the runtime specific data such as the stream list or event schedule data.

Parameters
orig_servservice to be copied
Returns
new copied service, NULL on failure

Creates a copy of the given service, copying the service's attributes, e.g. service name, scrambled, locked, hidde, etc, but not the runtime specific data such as the stream list or event schedule data.

Parameters
orig_servservice to be copied
Returns
new copied service, NULL on failure
ADB_STREAM_REC* DBDEF_CopyStreamList ( ADB_STREAM_REC slist)

Creates a copy of a stream list, allocating new memory as required.


Parameters
slistlist of stream recs to be copied
Returns
copied stream list
ADB_STRING* DBDEF_CopyString ( ADB_STRING src_str)

Creates a copy of the given ADB_STRING.

Parameters
src_strstring to be copied
Returns
new ADB_STRING
void DBDEF_DeleteAllServicesFromFavouriteList ( ADB_FAVLIST_REC fav_list)

Delete the all services from the given favourite list.

Parameters
fav_listfavourite list
void DBDEF_DeleteAltServList ( ADB_ALT_SERV_REC aslist)

Deletes all records in a service alternate service list.

Parameters
aslist- the first alt serv record in the list
void DBDEF_DeleteCridRecord ( ADB_CRID_REC c_ptr)

Deletes the given CRID record from the database.

Parameters
c_ptrpointer to CRID record to be deleted
void DBDEF_DeleteEventList ( ADB_EVENT_REC elist)

Deletes all events in the given list.

Parameters
elistlist of events to be deleted
void DBDEF_DeleteFavouriteList ( ADB_FAVLIST_REC fav_list)

Deletes the given favourite list.

Parameters
fav_listfavourite list to be deleted
void DBDEF_DeleteImageIcons ( ADB_IMAGE_ICON icon_list)

Frees given list of image icons and any associated memory.


Parameters
icon_listicon list to be freed
void DBDEF_DeleteLNBBandRec ( ADB_LNB_BAND_REC band_ptr)

Deletes an LNB band record from the database.

Parameters
band_ptrpointer to record to be deleted
void DBDEF_DeleteNetworkRec ( ADB_NETWORK_REC n_ptr)

Deletes specified network record.

Parameters
n_ptrPointer to network record
void DBDEF_DeleteRCTLinks ( ADB_RCT_LINK_INFO links)

Frees the given list of RCT links.


Parameters
linkslinks to be freed
void DBDEF_DeleteRecordsForTunerType ( E_STB_DP_SIGNAL_TYPE  tuner_type,
void *  satellite 
)

Deletes all network, transport and services records for the given tuner type.


Parameters
tuner_typetuner type
satelliteonly used when tuner_type == SIGNAL_QPSK to specify the satellite from which services should be deleted. If tuner_type is SIGNAL_QPSK and satellite is NULL then all DVB-S services will be deleted.
void DBDEF_DeleteServiceFromFavouriteList ( ADB_FAVLIST_REC fav_list,
ADB_FAVSERV_REC fav_serv 
)

Delete the given service from the given favourite list.

Parameters
fav_listfavourite list to delete service from
fav_servservice to be deleted from the favourite list
void DBDEF_DeleteServiceRec ( ADB_SERVICE_REC s_ptr)

Deletes specified service record.

Parameters
s_ptr- pointer to service record
void DBDEF_DeleteStreamList ( ADB_STREAM_REC slist)

Deletes all records in a service stream list.

Parameters
slist- the first stream record in the stream list
void DBDEF_DeleteTimerRec ( ADB_TIMER_REC timer)

Deletes the given timer from the database.

Parameters
timertimer to be deleted
void DBDEF_DeleteTransportRec ( ADB_TRANSPORT_REC t_ptr)

Deletes the given transport from the service database.

Parameters
t_ptrpointer to transport to be deleted

Deletes the given transport from the service database.

Parameters
t_ptrpointer to transport to be deleted
ADB_TRANSPORT_REC* DBDEF_FindCableTransportRec ( U32BIT  freq_hz,
U32BIT  symbol_rate 
)

Find the cable transport record in the database matching the given params.

Parameters
freq_hzfrequency in Hz
symbol_ratesymbol rate
Returns
pointer to the transport record or NULL if not found
ADB_EVENT_DESC* DBDEF_FindEventDescriptor ( ADB_EVENT_DESC start_desc,
U8BIT  desc_tag,
U32BIT  private_data_specifier 
)

Searches a descriptor list for the first descriptor with the given descriptor tag.

Parameters
start_descdescriptor where the search should start
desc_tagdescriptor tag to be found
private_data_specifierthe value of the private data specifier that must precede the descriptor being searched for. Use 0 if it isn't required.
Returns
pointer to the descriptor, or NULL if not found
ADB_FAVLIST_REC* DBDEF_FindFavouriteList ( U8BIT  list_id)

Return the favourite list with the given list id.

Parameters
list_idfavourite list id to find
Returns
pointer to favourite list record, or NULL if not found
ADB_NETWORK_REC* DBDEF_FindNetworkRec ( U16BIT  net_id,
ADB_SATELLITE_REC satellite 
)

Finds the network with the given network ID.

Parameters
net_idnetwork ID to be found
satellitesatellite the network is on, can be NULL
Returns
pointer to network record, or NULL if not found
ADB_NETWORK_REC* DBDEF_FindOrAddPrivateNetwork ( void *  satellite)

Find or add a private network, assigning an unused private network ID.

Parameters
satelliteoptional satellite, can be NULL
Returns
pointer to existing or new network record
ADB_TRANSPORT_REC* DBDEF_FindSatTransportRec ( U32BIT  freq_hz,
U16BIT  symbol_rate,
E_STB_DP_POLARITY  polarity,
BOOLEAN  dvb_s2,
E_STB_DP_MODULATION  modulation,
void *  satellite 
)

Find the satellite transport record in the database matching the given params.

Parameters
freq_hzfrequency in Hz
symbol_ratesymbol rate
dvb_s2TRUE if DVB-S2
modulationmodulation type
Returns
pointer to the transport record or NULL if not found
ADB_EVENT_REC* DBDEF_FindScheduleEventById ( ADB_SERVICE_REC s_ptr,
U16BIT  event_id 
)

Find an event for a service from its event_id.

Parameters
s_ptrservice to be searched
event_idID of the event to be found
Returns
pointer to the ADB_EVENT_REC, or NULL if not found
ADB_FAVSERV_REC* DBDEF_FindServiceInFavouriteList ( ADB_FAVLIST_REC fav_list,
void *  serv_ptr 
)

Returns the ADB_FAVSERV_REC from the given favourite list for the given service.

Parameters
fav_listfavourite list to be searched
serv_ptrservice to be searched for
Returns
pointer to service record, or NULL if not found
ADB_SERVICE_REC* DBDEF_FindServiceRecByFreesatId ( ADB_SERVICE_REC servp,
U16BIT  freesat_id 
)

Search for a service with the given Freesat ID.

Parameters
servpstart searching from this service, NULL to start from first service
freesat_idFreesat service ID
Returns
pointer to the next service found, or NULL if no service found
ADB_SERVICE_REC* DBDEF_FindServiceRecByIds ( ADB_SERVICE_REC servp,
U32BIT  net_id,
U32BIT  onet_id,
U32BIT  tran_id,
U32BIT  serv_id 
)

Search for a service with the given IDs.

Parameters
servpstart searching from this service, NULL to start from first service
net_idnetwork ID, use ADB_INVALID_DVB_ID if not to be used
onet_idoriginal network ID, use ADB_INVALID_DVB_ID if not to be used
tran_idtransport ID, use ADB_INVALID_DVB_ID if not to be used
serv_idservice ID, use ADB_INVALID_DVB_ID if not to be used
Returns
pointer to the next service found, or NULL if no service found
ADB_SERVICE_REC* DBDEF_FindServiceRecByLcn ( U16BIT  lcn,
ADB_TRANSPORT_REC t_ptr,
BOOLEAN  allocated_lcn 
)

Find the service with the given LCN, and optionally on the given transport.

Parameters
lcnLCN
t_ptrtransport the service must be on, use NULL for any transport
allocated_lcnTRUE if the search should be based on the LCN a service has been allocated rather than the one it requested (its service LCN)
Returns
pointer to service if found, NULL otherwise
ADB_TRANSPORT_REC* DBDEF_FindTerrestrialTransportRec ( U32BIT  freq_hz,
U8BIT  plp_id 
)

Find the terrestrial transport record in the database matching the given params.

Parameters
freq_hzfrequency in Hz
plp_idPLP id for T2, pass 0 to T
Returns
pointer to the transport record or NULL if not found
ADB_TIMER_REC* DBDEF_FindTimerRec ( U32BIT  handle)

Returns the timer record with the given timer handle.

Parameters
handletimer handle
Returns
pointer to the timer record, or NULL if not found
ADB_TRANSPORT_REC* DBDEF_FindTransportRecByIds ( ADB_TRANSPORT_REC transp,
U32BIT  net_id,
U32BIT  onet_id,
U32BIT  tran_id 
)

Find a transport record matching the given set of IDs, starting from the given transport.

Parameters
transpstart search from this transport, use NULL to start from the first transport
net_idnetwork ID, use ADB_INVALID_DVB_ID to ignore this value
onet_idoriginal network ID, use ADB_INVALID_DVB_ID to ignore this value
tran_idtransport ID, use ADB_INVALID_DVB_ID to ignore this value
Returns
pointer to transport record, NULL if none found
U8BIT* DBDEF_GetAudioLang ( void  )

returns current audio lang

Returns
lang id
ADB_PROFILE_TYPE DBDEF_GetCurrentProfileType ( void  )

Returns the current profile type.

Returns
Current profile type in use
BOOLEAN DBDEF_GetEventAudioDescriptionFlag ( ADB_EVENT_REC e_ptr)

Returns whether audio description is signalled as being available for the given event.

Parameters
e_ptrevent
Returns
TRUE if available, FALSE otherwise
U8BIT DBDEF_GetEventComponentList ( ADB_EVENT_REC e_ptr,
ADB_EVENT_COMPONENT_INFO **  component_list 
)

Retrieves a list of components associated with the specified event, as described by component descriptors in the EIT.

Parameters
e_ptrPointer to the event
component_listPointer to the returned list of components. The list must be freed by calling STB_AppFreeMemory, provided the returned number of components is greater than 0.
Returns
Number of components associated with the specified event.
U8BIT* DBDEF_GetEventContentData ( ADB_EVENT_REC e_ptr,
U8BIT *  p_len 
)

Returns the level 1 and 2 values for all content identifiers for the given event.

Parameters
e_ptrevent
p_lenaddress to return the number of bytes in the returned data
Returns
pointer to the content data
Parameters
event_ptrevent
p_lenaddress to return the number of bytes in the returned data
Returns
pointer to the content data
U8BIT* DBDEF_GetEventCrid ( ADB_SERVICE_REC serv_ptr,
ADB_EVENT_REC e_ptr,
U8BIT  crid_type,
U8BIT  index 
)

Returns the full CRID of the type given for the given event.

Parameters
serv_ptrservice for the event
e_ptrevent CRID to be returned
crid_typeCRID type to be returned (CRID_TYPE_PROGRAMME, CRID_TYPE_SERIES, or CRID_TYPE_RECOMMENDATION)
indexthe index of the CRID to be returned (only valid for series CRIDs)
Returns
pointer to a string containing the CRID name, or NULL if the event doesn't have the requested CRID type
Parameters
serv_ptrservice for the event
event_ptrevent CRID to be returned
crid_typeCRID type to be returned
indexthe index of the CRID to be returned (only valid for series CRIDs)
Returns
pointer to a string containing the CRID name, or NULL if the event doesn't have the requested CRID type
U8BIT* DBDEF_GetEventDescription ( ADB_EVENT_REC e_ptr)

Returns the short event description text of the event as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString.

Parameters
e_ptrevent
Returns
pointer to UTF-8 string, NULL on error
U8BIT* DBDEF_GetEventExtendedDescription ( ADB_EVENT_REC e_ptr)

Returns the extended event description text of the event as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString.

Parameters
e_ptrevent
Returns
pointer to UTF-8 string, NULL on error
ADB_EVENT_CONTENT DBDEF_GetEventGenre ( ADB_EVENT_REC e_ptr,
ADB_SERVICE_REC s_ptr 
)

Returns the genre of an event.

Parameters
e_ptrevent
s_ptrservice containing the event
Returns
event content value, ADB_EVENT_CONTENT_UNCLASSIFIED if not available
U8BIT* DBDEF_GetEventGuidance ( ADB_EVENT_REC e_ptr,
ADB_SERVICE_REC s_ptr,
U8BIT *  type,
U8BIT *  mode 
)

Returns the guidance text for an event, either from the event itself or the event's service, as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString.

Parameters
e_ptrevent, can be NULL, in which case any guidance defined by the service will be returned
s_ptrservice, can be NULL to just get guidance text from the event
typepointer to value to return the guidance type, valid if guidance text is returned
modepointer to value to return the guidance mode, valid if guidance text is returned
Returns
pointer to UTF-8 guidance string, NULL if there isn't any guidance text
BOOLEAN DBDEF_GetEventHDLinkageInfo ( ADB_EVENT_REC e_ptr,
BOOLEAN  verify_event,
BOOLEAN  only_simulcast,
ADB_SERVICE_REC **  hd_serv_ptr,
ADB_EVENT_REC **  hd_event_ptr 
)

Returns whether there's an HD event linked to the SD event and returns the info for it. The DVB info is checked to ensure it relates to a known service.

Parameters
e_ptrpointer to the event to check
verify_eventTRUE, if the schedule should be checked for the target event
only_simulcastTRUE, if only an HD simulcast event should be returned
hd_serv_ptrpointer to return the service for the HD event, if found. This can be NULL if not required.
hd_event_ptrpointer to return the HD event, if found. Note that this will only be filled in if verify_event is TRUE. This can be NULL if not required.
Returns
TRUE if an event is found, FALSE otherwise
ADB_EVENT_ITEMIZED_INFO* DBDEF_GetEventItemizedDescription ( ADB_EVENT_REC e_ptr,
U16BIT *  num_items_ptr 
)

Returns the items of extended event descriptor as item descriptor and item itself.

Parameters
e_ptrevent
num_items_ptraddress in which to return the number of items
Returns
ADB_EVENT_ITEMIZED_INFO pointer to the list of items, NULL on error
U8BIT* DBDEF_GetEventName ( ADB_EVENT_REC e_ptr)

Returns the name of the event as a UTF-8 string in the currently selected language. The returned string should be freed using STB_ReleaseUnicodeString.

Parameters
e_ptrevent
Returns
pointer to UTF-8 string, NULL on error
U8BIT DBDEF_GetEventParentalAge ( ADB_EVENT_REC e_ptr)

Returns the parental age value for the given event.

Parameters
e_ptrevent
Returns
parental age value, 0 for invalid event
BOOLEAN DBDEF_GetEventSubtitlesAvailFlag ( ADB_EVENT_REC e_ptr)

Returns whether DVB subtitles are signalled as being available for the given event.

Parameters
e_ptrevent
Returns
TRUE if subtitles are available, FALSE otherwise
U8BIT* DBDEF_GetFullCrid ( ADB_SERVICE_REC serv_ptr,
U8BIT *  event_str 
)

Returns the full CRID for the given CRID string The returned string should be freed using STB_AppFreeMemory.

Parameters
serv_ptrservice for the event
event_strCRID string
Returns
pointer to a string containing the CRID name
ADB_CRID_REC* DBDEF_GetNextCridRecord ( ADB_CRID_REC c_ptr)

Returns the next CRID record after the one specified. If the record specified is NULL then the first record is returned.

Parameters
c_ptrCRID record pointer, NULL if first record is required
Returns
pointer to the next record after the one specified
ADB_FAVLIST_REC* DBDEF_GetNextFavouriteList ( ADB_FAVLIST_REC fav_list)

Returns the favourite list following the given item.

Parameters
fav_listreturn the item after this one, if NULL, returns the first item
Returns
next favourite list, or NULL if no more
ADB_LNB_BAND_REC* DBDEF_GetNextLNBBandRec ( ADB_LNB_BAND_REC band_ptr)

Returns the next LNB band record after the one given. If the argument is NULL then the first record is returned.

Parameters
band_ptrLNB band record pointer, NULL if first record is required
Returns
pointer to next LNB band record
ADB_LNB_REC* DBDEF_GetNextLNBRec ( ADB_LNB_REC lnb_ptr)

Returns the next LNB record after the one given. If the argument is NULL then the first record is returned.

Parameters
lnb_ptrLNB record pointer, NULL if first record is required
Returns
pointer to next LNB record
ADB_NETWORK_REC* DBDEF_GetNextNetworkRec ( ADB_NETWORK_REC n_ptr)

Returns the network following the one given. If the argument is NULL then the first network will be returned.

Parameters
n_ptrnetwork record, NULL if first network is required
Returns
pointer to next network, NULL if no more networks
ADB_SATELLITE_REC* DBDEF_GetNextSatelliteRec ( ADB_SATELLITE_REC sat_ptr)

Returns the next satellite record after the one given. If the argument is NULL then the first record is returned.

Parameters
sat_ptrsatellite record pointer, NULL if first record is required
Returns
pointer to next satellite record
ADB_FAVSERV_REC* DBDEF_GetNextServiceFromFavouriteList ( ADB_FAVLIST_REC fav_list,
ADB_FAVSERV_REC fav_serv 
)

Returns the next favourite list service record.

Parameters
fav_listfavourite list
fav_servcurrent service, or NULL if first service to be returned
Returns
pointer to service record, or NULL if no more services
ADB_SERVICE_REC* DBDEF_GetNextServiceOnTransport ( ADB_SERVICE_REC s_ptr,
ADB_TRANSPORT_REC t_ptr 
)

Find the next service following the given service that's on the given transport.

Parameters
s_ptrfind the service after this one, use NULL to get the first service
t_ptrtransport the service is on
Returns
pointer to the service found, or NULL if not found
ADB_SERVICE_REC* DBDEF_GetNextServiceRec ( ADB_SERVICE_REC s_ptr)

Returns the service after the one given. If NULL is passed then the first service in the list is returned.

Parameters
s_ptrpointer to service, NULL if first service is to be returned
Returns
pointer to service, or NULL if no more services
ADB_TIMER_REC* DBDEF_GetNextTimerRec ( ADB_TIMER_REC timer_ptr)

Returns the next timer record after the one given. If the argument is NULL then the first record is returned.

Parameters
timer_ptrtimer record pointer, NULL if first record is required
Returns
pointer to next timer record
ADB_TRANSPORT_REC* DBDEF_GetNextTransportRec ( ADB_TRANSPORT_REC t_ptr)

Returns the transport following the one given. If the argument is NULL then the first transport will be returned.

Parameters
t_ptrtransport record, NULL if first transport is required
Returns
pointer to next transport, NULL if no more transports
U16BIT DBDEF_GetNumCridRecords ( void  )

Returns the number of CRID records in the database.

Returns
number of records
U16BIT DBDEF_GetNumFavouriteLists ( void  )

Returns the number of favourite lists.

Returns
number of favourite lists
U16BIT DBDEF_GetNumLNBBands ( void  )

Returns the number of LNB band records in the database.

Returns
number of LNB band records
U16BIT DBDEF_GetNumLNBs ( void  )

Returns the number of LNB records in the database.

Returns
number of LNB records
U16BIT DBDEF_GetNumNetworks ( void  )

Returns the number of networks in ther service database.

Returns
number of transports
U16BIT DBDEF_GetNumSatellites ( void  )

Returns the number of satellite records in the database.

Returns
number of satellite records
U16BIT DBDEF_GetNumServices ( void  )

Returns the total number of services.

Returns
total number of services
U16BIT DBDEF_GetNumServicesInFavouriteList ( ADB_FAVLIST_REC fav_list)

Returns the number of services in the given favourite list.

Parameters
fav_listfavourite list
Returns
number of services
U16BIT DBDEF_GetNumTransports ( void  )

Returns the number of transports in ther service database.

Returns
number of transports
ADB_FAVSERV_REC* DBDEF_GetPrevServiceFromFavouriteList ( ADB_FAVLIST_REC fav_list,
ADB_FAVSERV_REC fav_serv 
)

Returns the previous favourite list service record.

Parameters
fav_listfavourite list
fav_servcurrent service, or NULL if last service to be returned
Returns
pointer to service record, or NULL if no more services
ADB_SERVICE_REC* DBDEF_GetPrevServiceRec ( ADB_SERVICE_REC s_ptr)

Returns the service before the one given. If NULL is passed then the last service in the list is returned.

Parameters
s_ptrpointer to service, NULL if last service is to be returned
Returns
pointer to service, or NULL if no more services
U16BIT DBDEF_GetProfileList ( void ***  profile_list,
U16BIT *  active_profile 
)

Gets a list of the available network profiles.

Parameters
profile_listaddress of pointer to an array that will be allocated by this function that will contain the profiles
active_profilepointer to return the index of the currently active profile
Returns
number of profiles in the returned array
U16BIT DBDEF_GetReqdADPid ( ADB_SERVICE_REC s_ptr,
E_STB_DP_AUDIO_MODE *  ad_mode,
ADB_STREAM_TYPE *  ad_type,
BOOLEAN *  broadcast_mix 
)

Gets the appropriate audio description pid - looks first for the pid matching exactly the required audio settings in the database, then for the pid matching the default language, then the first audip pid in the stream list. If no pid found the returned pid value will be 0.

Parameters
s_ptr- service record ptr
ad_mode- pointer to the returned channel setting (mono)
ad_type- pointer to the returned stream type (codec)
broadcast_mix- pointer to the returned boolean indicator of broadcast mix audio
Returns
required audio pid
U16BIT DBDEF_GetReqdAudioPid ( ADB_SERVICE_REC s_ptr,
E_STB_DP_AUDIO_MODE *  audio_mode,
ADB_STREAM_TYPE *  audio_type 
)

Gets the appropriate audio pid - looks first for the pid matching exactly the required audio settings in the database, then for the pid matching the default language, then the first audip pid in the stream list. If no pid found the returned pid value will be 0.

Parameters
s_ptr- service record ptr
audio_mode- pointer to the returned channel setting (mono, stereo, left, right)
audio_type- pointer to the returned stream type (codec)
Returns
required audio pid
E_STREAM_MATCH_TYPE DBDEF_GetReqdSubtitleParams ( ADB_SERVICE_REC s_ptr,
U16BIT *  pid_ptr,
U16BIT *  cpage_ptr,
U16BIT *  apage_ptr 
)

Gets the appropriate subtitle pid and page ids - looks first for the params matching exactly the required subtitle settings in the database, then for the pid matching the default language, then the first subtitle stream in the stream list. If no subtitles found the returned pid will be 0.

Parameters
s_ptr- service record ptr
pid_ptr- pointer for the return of the pid
cpage_ptr- pointer for the return of the composition page
apage_ptr- pointer for the return of the ancilliary page
E_STREAM_MATCH_TYPE DBDEF_GetReqdTtextPid ( ADB_SERVICE_REC s_ptr,
BOOLEAN  for_subtitles,
U16BIT *  pid_ptr,
U8BIT *  magazine,
U8BIT *  page 
)

Gets the appropriate teletext pid - looks first for the params matching exactly the required teletext settings in the database, then for the pid matching the default language, then the first teletext stream in the stream list. If no teletext found the returned pid will be 0.

Parameters
s_ptr- service record ptr
for_subtitles- TRUE if subtitle stream is to be selected
magazine- returns the magazine defined in the stream
page- returns the defined page in the stream
Returns
The required PID value
U16BIT DBDEF_GetReqdVideoPid ( ADB_SERVICE_REC s_ptr,
ADB_STREAM_TYPE *  video_type 
)

Returns the video pid and type that should be used for the given service from the list of video streams available. The "best one" is based on HD being better than SD and uses the priorities from the Nordig spec.


Parameters
s_ptrservice
video_typepointer used to return the type of the video selected
Returns
Selected video PID
U8BIT* DBDEF_GetSecondaryAudioLang ( void  )

returns current secondary audio lang

Returns
lang id
U8BIT* DBDEF_GetSecondaryTextLang ( void  )

returns array of secondary text langs

Returns
lang ids
U8BIT* DBDEF_GetServiceDefaultAuthority ( ADB_SERVICE_REC s_ptr)

Returns a copy of the default authority CRID string for the given service. This string will be returned as broadcast and should be freed using STB_AppFreMemory.

Parameters
c_ptrpointer to CRID record
Returns
pointer to a copy of the CRID string, or NULL
U8BIT* DBDEF_GetServiceGuidance ( ADB_SERVICE_REC s_ptr)

Returns the guidance text for the service, as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString.

Parameters
s_ptrservice
Returns
pointer to UTF-8 guidance string, NULL if there isn't any guidance text
U8BIT* DBDEF_GetServiceGuidanceData ( ADB_SERVICE_REC s_ptr,
U8BIT *  type,
U8BIT *  mode 
)

Returns the guidance text for the service, as a UTF-8 string. The returned string should be freed using STB_ReleaseUnicodeString.

Parameters
s_ptrservice
typepointer to value to return the guidance type, valid if guidance text is returned
modepointer to value to return the guidance mode, valid if guidance text is returned
Returns
pointer to UTF-8 guidance string, NULL if there isn't any guidance text
ADB_STRING* DBDEF_GetServiceName ( ADB_SERVICE_REC s_ptr,
BOOLEAN  short_name,
BOOLEAN  pref_name 
)

Returns a pointer to the service name, taking into account perferred names and short names, if available.

Parameters
s_ptrservice
short_nameTRUE if short name is to be returned, if available
pref_nameTRUE if preferred name is to be returned, if available
Returns
pointer to the service name
U16BIT DBDEF_GetServicePmtPid ( ADB_SERVICE_REC s_ptr)

gets the PMT PID associated with the service

Parameters
s_ptrpointer to the service
Returns
PMT PID
ADB_STRING* DBDEF_GetServiceProviderName ( ADB_SERVICE_REC s_ptr)

Returns a pointer to the service provider name.

Parameters
s_ptrservice
Returns
pointer to the service provider name
U8BIT* DBDEF_GetTextLang ( void  )

returns array of current text langs

Returns
lang ids
ADB_NETWORK_REC* DBDEF_GetTunedNetwork ( U8BIT  path)

gets the currently tuned network

Returns
pointer to the network
ADB_SERVICE_REC* DBDEF_GetTunedService ( U8BIT  path)

Returns the currently tuned service on the given path.


Parameters
pathdecode path
Returns
service pointer
ADB_TRANSPORT_REC* DBDEF_GetTunedTransport ( U8BIT  path)

gets the currently tuned transport

Returns
pointer to the transport
BOOLEAN DBDEF_IsActiveProfile ( ADB_NETWORK_REC profile)

Is the given profile the currently active profile?

Parameters
profileprofile
Returns
TRUE if the given profile is the currently active profile, FALSE otherwise
BOOLEAN DBDEF_IsValidCridRecord ( ADB_CRID_REC c_ptr)

Checks whether the given crid record is in the list of valid crid records.

Parameters
c_ptrcrid record to look for
Returns
TRUE if crid record is valid, FALSE otherwise
BOOLEAN DBDEF_LoadDatabase ( U8BIT *  db_pathname)

Loads the service database from non-volatile storage and creates the RAM version of this data that will be used by the DVB stack.

Parameters
db_pathnamepathname of the database file to be loaded, may be NULL or ignored if not relevant for the type of storage being used.
Returns
TRUE if the database is loaded, FALSE otherwise
ADB_STRING* DBDEF_MakeString ( U32BIT  lang_code,
U8BIT *  str_ptr,
U16BIT  nbytes 
)

Creates an ADB_STRING, copying the given data into it. If the string passed in is NULL or the number of bytes is 0, then no string will be created.

Parameters
lang_codeISO 639-2 3 char language code
str_ptrpointer to string data to be copied into the ADB_STRING
nbytesnumber of bytes of string data
Returns
pointer to new ADB_STRING, or NULL
void DBDEF_MoveFavouriteListServiceTo ( ADB_FAVLIST_REC fav_list,
ADB_FAVSERV_REC fav_serv,
S16BIT  index 
)

Changes the order of the services in the favourite list by moving the given service to the given position.

Parameters
fav_listfavourite list
fav_servservice to be moved
indexposition to move the service to
Returns
TRUE if successful, FALSE otherwise
void DBDEF_MoveFavouriteListTo ( ADB_FAVLIST_REC fav_list,
S16BIT  index 
)

Changes the order of the favourite lists by moving the given list to the given position.

Parameters
fav_listfavourite list to be moved
indexposition to move the list to
Returns
TRUE if successful, FALSE otherwise
BOOLEAN DBDEF_NetworkInProfile ( ADB_NETWORK_REC n_ptr)

Checks whether the given network is valid for the current profile. There may be multiple CI+ profiles and so data related to the CAM is also checked.

Parameters
n_ptrnetwork to be checked
Returns
TRUE if the network is in the current profile, FALSE otherwise
ADB_SERVICE_REC* DBDEF_NewServiceRec ( U16BIT  serv_id,
ADB_TRANSPORT_REC t_ptr,
BOOLEAN  prepend 
)

Adds a new service record to the service database with the given service ID and parent transport. With prepend set to FALSE, same as DBDEF_AddServiceRec.

Parameters
serv_idservice ID for the new service
t_ptrparent transport for the new service
prependTRUE - add service at beginning of list, FALSE - add at end of list
Returns
pointer to the new service, or NULL if the creation fails
U8BIT DBDEF_NumberOfCridsOfType ( ADB_EVENT_REC e_ptr,
U8BIT  crid_type 
)

Returns the number of CRIDs of the given type for the event.

Parameters
e_ptrcounting the CRIDs for this event
crid_typeCRID type to be returned (CRID_TYPE_PROGRAMME, CRID_TYPE_SERIES, or CRID_TYPE_RECOMMENDATION)
Returns
number of CRIDs found
Parameters
event_ptrcounting the CRIDs for this event
crid_typeCRID type to be returned
Returns
number of CRIDs found
U16BIT DBDEF_NumStreamsInList ( ADB_STREAM_REC slist)

Returns the number of stream records in the given list.


Parameters
slistlist of stream recs
Returns
Number of stream recs
void DBDEF_ReleaseProfileList ( void **  profile_list,
U16BIT  num_profiles 
)

Frees a profile list returned by DBDEF_GetProfileList.

Parameters
profile_listprofile list to be freed
num_profilesnumber of profiles in the list
void DBDEF_ReleaseString ( ADB_STRING string)

Releases an ADB_STRING.

Parameters
stringstring to be freed
void DBDEF_RemoveEmptyTransports ( E_STB_DP_SIGNAL_TYPE  tuner_type,
void *  satellite 
)

Delete all transport records that don't have any services.

Parameters
tuner_type- empty transports of this signal type will be deleted
satellite- if the signal type is SIGNAL_QPSK then this parameter specifies the satellite the transports must be on. Ignored if tuner type isn't SIGNAL_QPSK, and can be NULL to indicate all satellites.
void DBDEF_SaveServiceEventSchedule ( ADB_SERVICE_REC s_ptr)

Saves the event schedule of a service to the service database.

Parameters
s_ptrevent data to be saved for this service
BOOLEAN DBDEF_ServiceForTunerType ( ADB_SERVICE_REC s_ptr,
E_STB_DP_SIGNAL_TYPE  tuner_type,
void *  satellite 
)

Checks whether the given service is a terrestrial, cable or satellite service, and optionally check whether it's on a particular satellite.

Parameters
s_ptrservice to be checked
tuner_typetype of tuner to check
satelliteif tuner type is SIGNAL_QPSK then check whether the service is from this satellite. This can be NULL if the satellite isn't important and is ignored for a non-satellite tuner.
Returns
TRUE if the service is of the given type, FALSE otherwise
BOOLEAN DBDEF_ServiceInProfile ( ADB_SERVICE_REC s_ptr)

Checks whether the given service is valid for the current profile. There may be multiple CI+ profiles and so data related to the CAM is also checked.

Parameters
s_ptrservice to be checked
Returns
TRUE if the service isn't part of a network or is in the current profile, FALSE otherwise
void DBDEF_SetAnalogServiceName ( ADB_SERVICE_REC s_ptr,
U8BIT *  new_name,
U8BIT  new_len 
)

Updates analog service names - ASSUMES NORMAL ASCII CODED.

Parameters
s_ptr- service to be changed
new_name- pointer to new name
new_len- number of bytes in new name (incl null terminator)
void DBDEF_SetAudioLang ( U8BIT *  lang_ids)

sets current audio lang

Parameters
lang_id- id of required language
void DBDEF_SetCridDateTime ( ADB_CRID_REC c_ptr,
U32DHMS  date_time 
)

Sets the date and time fields in the crid record.

Parameters
c_ptrpointer to CRID record
date_timedate & time to set in the crid
void DBDEF_SetCridProgrammeName ( ADB_CRID_REC c_ptr,
U8BIT *  prog_name 
)

Sets the programme name field of the given CRID record.

Parameters
c_ptrpointer to CRID record
prog_namename string to save in the CRID record
void DBDEF_SetCridService ( ADB_CRID_REC c_ptr,
U16BIT  serv_id 
)

Sets the service ID in the crid record.

Parameters
c_ptrpointer to CRID record
serv_idservice ID
void DBDEF_SetFavouriteListName ( ADB_FAVLIST_REC f_ptr,
U8BIT *  name 
)

Set or change the name of the given favourite list.

Parameters
f_ptrpointer to favourite record to be updated
nameof the favourite list
Returns
void
void DBDEF_SetFavouriteListUserData ( ADB_FAVLIST_REC fav_list,
U32BIT  user_data 
)

Saves the given user data with a favourite list.

Parameters
fav_listfavourite list
user_datadata to be stored with the list
BOOLEAN DBDEF_SetLNB12V ( ADB_LNB_REC lnb,
BOOLEAN  is_12v 
)

Sets the LNB 12V setting.

Parameters
lnbpointer to LNB record
is_12v12V setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNB22k ( ADB_LNB_REC lnb,
BOOLEAN  is_22k 
)

Sets the LNB 22k setting.

Parameters
lnbpointer to LNB record
is_22k22k setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNBCSwitch ( ADB_LNB_REC lnb,
E_STB_DP_DISEQC_CSWITCH  cswitch 
)

Sets the LNB committed switch setting.

Parameters
lnbpointer to LNB record
cswitchswitch setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNBDiSEqCPosition ( ADB_LNB_REC lnb,
BOOLEAN  is_diseqc_posn 
)

Sets the LNB DiSEqC position setting.

Parameters
lnbpointer to LNB record
is_diseqc_posndiseqc position setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNBDiSEqCTone ( ADB_LNB_REC lnb,
E_STB_DP_DISEQC_TONE  diseqc_tone 
)

Sets the LNB DiSEqC tone setting.

Parameters
lnbpointer to LNB record
diseqc_tonediseqc tone setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNBPower ( ADB_LNB_REC lnb,
E_STB_DP_LNB_POWER  power 
)

Sets the LNB power setting.

Parameters
lnbpointer to LNB record
powerpower setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNBPulsePosition ( ADB_LNB_REC lnb,
BOOLEAN  is_pulse_posn 
)

Sets the LNB pulse position setting.

Parameters
lnbpointer to LNB record
is_pulse_posnpulse position setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNBRepeats ( ADB_LNB_REC lnb,
U8BIT  repeats 
)

Sets the LNB message repeat setting in the range 0 to 3.

Parameters
lnbpointer to LNB record
repeatsrepeat setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNBSmatv ( ADB_LNB_REC lnb,
BOOLEAN  is_smatv 
)

Sets the LNB SMATV setting.

Parameters
lnbpointer to LNB record
is_smatvSMATV setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNBUnicable ( ADB_LNB_REC lnb,
U32BIT  inter_freq,
U8BIT  chan 
)

Sets the LNB Unicable settings.

Parameters
lnbpointer to LNB record
inter_freqintermediate frequency setting
chanchannel setting
Returns
TRUE if value set successfully, FALSE otherwise
BOOLEAN DBDEF_SetLNBUSwitch ( ADB_LNB_REC lnb,
U8BIT  uswitch 
)

Sets the LNB uncommitted switch setting.

Parameters
lnbpointer to LNB record
uswitchswitch setting
Returns
TRUE if value set successfully, FALSE otherwise
void DBDEF_SetNetworkName ( ADB_NETWORK_REC n_ptr,
U8BIT *  name 
)

Set or change the name of the given network.

Parameters
n_ptrpointer to network record to be updated
namename to be given to the network, can be any format, or NULL to clear the network name
void DBDEF_SetSatTransportTuningParams ( ADB_TRANSPORT_REC t_ptr,
U32BIT  freq_hz,
U16BIT  symbol_rate,
E_STB_DP_POLARITY  polarity,
BOOLEAN  dvb_s2,
E_STB_DP_MODULATION  modulation,
ADB_NETWORK_REC network 
)

Sets the tuning parameters for an existing satellite transport.

Parameters
t_ptrsatellite transport record
freq_hzfrequency in Hz
symbol_ratesymbol rate
polaritypolarity
dvb_s2TRUE for DVB-S2
modulationmodulation type
networknetwork the transport is on, can be NULL
void DBDEF_SetSecondaryAudioLang ( U8BIT *  lang_ids)

sets the secondary audio lang

Parameters
lang_ids- ids of required language
void DBDEF_SetSecondaryTextLang ( U8BIT *  lang_ids)

sets secondary text lang

Parameters
lang_ids- array of required language ids
void DBDEF_SetServiceFavGroups ( ADB_SERVICE_REC s_ptr,
U8BIT  groups 
)

Sets the favourite groups for a service.

Parameters
s_ptrservice
groupsbitmask containing the favourite groups the service is to be in
BOOLEAN DBDEF_SetServiceName ( ADB_SERVICE_REC s_ptr,
U8BIT *  name 
)

Set or change the name of a service.

Parameters
s_ptrservice
namename to be given to the service, can be any format, or NULL to clear the current name
Returns
TRUE if the name is changed, FALSE otherwise
void DBDEF_SetServicePmtPid ( ADB_SERVICE_REC s_ptr,
U16BIT  pmt_pid 
)

Updates the pmt pid.

Parameters
s_ptr- service to be changed
pmt_pid- PID of the PMT associated with the service
BOOLEAN DBDEF_SetServiceProviderName ( ADB_SERVICE_REC s_ptr,
U8BIT *  name 
)

Set or change the name of a service's provider.

Parameters
s_ptrservice
namename to be given to the service's provider, can be any format, or NULL to clear the current name
Returns
TRUE if the name is changed, FALSE otherwise
BOOLEAN DBDEF_SetServiceShortName ( ADB_SERVICE_REC s_ptr,
U8BIT *  name 
)

Set or change the short name of a service.

Parameters
s_ptrservice
namenew short name of the service, can be any format, or NULL to clear the current name
Returns
TRUE if the name is changed, FALSE otherwise
BOOLEAN DBDEF_SetServiceType ( ADB_SERVICE_REC s_ptr,
ADB_SERVICE_TYPE  serv_type 
)

Sets the service type for the given service record.

Parameters
s_ptrservice
serv_typetype of service
Returns
TRUE if the type is changed, FALSE otherwise
void DBDEF_SetTextLang ( U8BIT *  lang_ids)

sets current text lang

Parameters
lang_ids- array of required language ids
void DBDEF_SetTransportOrigNetworkId ( ADB_TRANSPORT_REC t_ptr,
U16BIT  orig_net_id 
)

Sets the original network ID of the given transport.

Parameters
t_ptrtransport record the ID will be set for
orig_net_idoriginal network ID to be set
void DBDEF_SetTransportTransportId ( ADB_TRANSPORT_REC t_ptr,
U16BIT  tran_id 
)

Sets the transport ID of the given transport.

Parameters
t_ptrtransport record the ID will be set for
tran_idtransport ID to be set
void DBDEF_SetTunedNetwork ( U8BIT  path,
ADB_NETWORK_REC n_ptr 
)

sets the currently tuned network

Parameters
t_ptr- pointer to the network
void DBDEF_SetTunedService ( U8BIT  path,
ADB_SERVICE_REC s_ptr 
)

Sets the currently tuned service.


Parameters
pathdecode path
s_ptrservice tuned to
void DBDEF_SetTunedTransport ( U8BIT  path,
ADB_TRANSPORT_REC t_ptr 
)

sets the currently tuned transport

Parameters
t_ptr- pointer to the transport
void DBDEF_SortTimers ( BOOLEAN  date_time_order)

Sorts timer list into date/time or alphabetical order.

Parameters
date_time_orderTRUE to sort into date/time order, FALSE for alphabetical
void DBDEF_TidyDatabaseAfterSearch ( E_STB_DP_SIGNAL_TYPE  tuner_type,
void *  satellite,
BOOLEAN  search_completed,
BOOLEAN  manual 
)

Calls any country and tuner type specific function to tidy up the database following a search, such as removing duplicate services, etc.

Parameters
tuner_typetuner type used for the search
satellitesatellite search was performed on for SIGNAL_QPSK, ignored otherwise
search_completedTRUE if the search completed, FALSE if terminated prematurely
manualTRUE if a manual search was performed, FALSE otherwise
void DBDEF_TidyDatabaseDefault ( E_STB_DP_SIGNAL_TYPE  tuner_type,
BOOLEAN  search_completed,
BOOLEAN  manual 
)

Iterates through all the services following a search search to see whether any need to be deleted based on the rules for that country.

Parameters
tuner_typetuner type used for the search
search_completedTRUE if the search completed, FALSE if terminated prematurely
manualTRUE if a manual search was performed, FALSE otherwise
void DBDEF_TidyDatabaseNordig ( E_STB_DP_SIGNAL_TYPE  tuner_type,
BOOLEAN  search_completed,
BOOLEAN  manual 
)

Iterates through all the services following a search search to see whether any need to be deleted based on the rules for that country.

Parameters
tuner_typetuner type used for the search
search_completedTRUE if the search completed, FALSE if terminated prematurely
manualTRUE if a manual search was performed, FALSE otherwise
void DBDEF_TidyDatabaseSatUK ( E_STB_DP_SIGNAL_TYPE  tuner_type,
BOOLEAN  search_completed,
BOOLEAN  manual 
)

Iterates through all the services following a search search to see whether any need to be deleted based on the rules for that country.

Parameters
tuner_typetuner type used for the search
search_completedTRUE if the search completed, FALSE if terminated prematurely
manualTRUE if a manual search was performed, FALSE otherwise
void DBDEF_TidyDatabaseUK ( E_STB_DP_SIGNAL_TYPE  tuner_type,
BOOLEAN  search_completed,
BOOLEAN  manual 
)

Iterates through all the services following a search search to see whether any need to be deleted based on the rules for that country.

Parameters
tuner_typetuner type used for the search
search_completedTRUE if the search completed, FALSE if terminated prematurely
manualTRUE if a manual search was performed, FALSE otherwise
BOOLEAN DBDEF_TransportForTunerType ( ADB_TRANSPORT_REC t_ptr,
E_STB_DP_SIGNAL_TYPE  tuner_type,
void *  satellite 
)

Checks whether the given transport is a terrestrial, cable or satellite transport, and optionally check whether it's on a particular satellite.

Parameters
t_ptrtransport to be checked
tuner_typetype of tuner to check
satelliteif tuner type is SIGNAL_QPSK then check whether the transport is from this satellite. This can be NULL if the satellite isn't important and is ignored for a non-satellite tuner.
Returns
TRUE if the transport is of the given type, FALSE otherwise
BOOLEAN DBDEF_TransportInProfile ( ADB_TRANSPORT_REC t_ptr)

Checks whether the given transport is valid for the current profile. There may be multiple CI+ profiles and so data related to the CAM is also checked.

Parameters
t_ptrtransport to be checked
Returns
TRUE if the transport isn't part of a network or is in the current profile, FALSE otherwise
void DBDEF_UpdateCridEitDate ( ADB_CRID_REC c_ptr)

Updates the stored EIT date of this CRID with the current GMT date.

Parameters
c_ptrpointer to CRID record