DVBCore  20.3.0
DVBCore Documentation
ap_cfg.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 // debug macros
26 
27 //---includes for this file-------------------------------------------------------------------------
28 // compiler library header files
29 #include <string.h>
30 
31 // third party header files
32 
33 // Ocean Blue Software header files
34 #include "techtype.h"
35 #include "dbgfuncs.h"
36 
37 #include "stbheap.h"
38 #include "stbdpc.h"
39 #include "stbsiflt.h"
40 #include "stbsitab.h"
41 #include "stbllist.h"
42 
43 #ifdef COMMON_INTERFACE
44 #include "stbci.h"
45 #endif
46 
47 #include "app.h"
48 #include "ap_cfg.h"
49 #include "app_nvm.h"
50 #include "ap_tmr.h"
51 #include "ap_dbacc.h"
52 #include "ap_dbdef.h"
53 
54 //---constant definitions for this file-------------------------------------------------------------
55 
56 #define NUM_COUNTRIES (sizeof(country_data_table) / sizeof(ACFG_COUNTRY_CONFIG))
57 
58 //---local typedefs, structs, enumerations for this file--------------------------------------------
59 
60 
61 //---local (static) variable declarations for this file---------------------------------------------
62 // (internal variables declared static to make them local)
63 
64 static U32BIT und_lang_code = ADB_LANG_CODE_UNDEF;
65 #ifdef COMMON_INTERFACE
66 static U32BIT ci_hcl_module = 0;
67 #endif
68 
69 //---local function prototypes for this file--------------------------------------------------------
70 // (internal functions declared static to make them local)
71 static U8BIT GetCountryId(U32BIT country_code);
72 
73 
74 //--------------------------------------------------------------------------------------------------
75 // include file containing configuration data declarations. Must be included here AFTER typedefs.
76 #define DECLARE_DATA_TABLES
77 #define DECLARE_DB_LANG_LIST // include db_lang_list[] defined in ap_cfdat.h
78 #include "ap_cfdat.h"
79 #undef DECLARE_DB_LANG_LIST
80 #undef DECLARE_DATA_TABLES
81 //--------------------------------------------------------------------------------------------------
82 
83 
84 
85 //--------------------------------------------------------------------------------------------------
86 // local function definitions
87 //--------------------------------------------------------------------------------------------------
88 
89 #ifdef COMMON_INTERFACE
90 
94 static void CISetHostCountryCode(U32BIT code)
95 {
96  U8BIT country_code[3];
97  FUNCTION_START(CISetHostCountryCode);
98  if (ci_hcl_module)
99  {
100  /* Make sure the code in in uppercase */
101  code &= ~0x00202020;
102  country_code[0] = (U8BIT)(code >> 16);
103  country_code[1] = (U8BIT)(code >> 8);
104  country_code[2] = (U8BIT)code;
105  STB_CISetHostCountryCode(ci_hcl_module, country_code);
106  }
107  FUNCTION_FINISH(CISetHostCountryCode);
108 }
109 
114 static void CISetHostLanguageCode(U32BIT code)
115 {
116  U8BIT lang_code[3];
117  FUNCTION_START(CISetHostLanguageCode);
118  if (ci_hcl_module)
119  {
120  lang_code[0] = (U8BIT)(code >> 16);
121  lang_code[1] = (U8BIT)(code >> 8);
122  lang_code[2] = (U8BIT)code;
123  STB_CISetHostLanguageCode(ci_hcl_module, lang_code);
124  }
125  FUNCTION_FINISH(CISetHostLanguageCode);
126 }
127 
128 #endif // COMMON_INTERFACE
129 
130 //--------------------------------------------------------------------------------------------------
131 // global function definitions
132 //--------------------------------------------------------------------------------------------------
133 
134 
140 {
141  FUNCTION_START(ACFG_GetNumCountries);
142  FUNCTION_FINISH(ACFG_GetNumCountries);
143  return(NUM_COUNTRIES);
144 }
145 
150 U32BIT ACFG_GetCountry(void)
151 {
152  U32BIT country_code;
153 
154  FUNCTION_START(ACFG_GetCountry);
155  country_code = APP_NvmRead(COUNTRY_CODE_NVM);
156  FUNCTION_FINISH(ACFG_GetCountry);
157 
158  return(country_code);
159 }
160 
166 U8BIT ACFG_GetCountryIndex(U32BIT country_code)
167 {
168  U8BIT index;
169 
170  FUNCTION_START(ACFG_GetCountryIndex);
171 
172  for (index = 0; index < NUM_COUNTRIES; index++)
173  {
174  if (country_data_table[index].country_code == country_code)
175  {
176  break;
177  }
178  }
179 
180  FUNCTION_FINISH(ACFG_GetCountryIndex);
181 
182  return(index);
183 }
184 
189 U8BIT ACFG_GetRegionId(void)
190 {
191  U8BIT region_id;
192 
193  FUNCTION_START(ACFG_GetRegionId);
194  region_id = (U8BIT)APP_NvmRead(REGION_ID_NVM);
195  FUNCTION_FINISH(ACFG_GetRegionId);
196 
197  return(region_id);
198 }
199 
205 {
206  U8BIT lang_id;
207 
208  FUNCTION_START(ACFG_GetPrimaryAudioLangId);
209  lang_id = (U8BIT)APP_NvmRead(PRIMARY_AUDIO_LANG_NVM);
210  FUNCTION_FINISH(ACFG_GetPrimaryAudioLangId);
211 
212  return(lang_id);
213 }
214 
220 {
221  U8BIT lang_id;
222 
223  FUNCTION_START(ACFG_GetSecondaryAudioLangId);
224  lang_id = (U8BIT)APP_NvmRead(SECONDARY_AUDIO_LANG_NVM);
225  FUNCTION_FINISH(ACFG_GetSecondaryAudioLangId);
226 
227  return(lang_id);
228 }
229 
235 {
236  U8BIT lang_id;
237 
238  FUNCTION_START(ACFG_GetPrimaryTextLangId);
239  lang_id = (U8BIT)APP_NvmRead(PRIMARY_TEXT_LANG_NVM);
240  FUNCTION_FINISH(ACFG_GetPrimaryTextLangId);
241 
242  return(lang_id);
243 }
244 
250 {
251  U8BIT lang_id;
252 
253  FUNCTION_START(ACFG_GetSecondaryTextLangId);
254  lang_id = (U8BIT)APP_NvmRead(SECONDARY_TEXT_LANG_NVM);
255  FUNCTION_FINISH(ACFG_GetSecondaryTextLangId);
256 
257  return(lang_id);
258 }
259 
265 BOOLEAN ACFG_SetCountry(U32BIT country_code)
266 {
267  BOOLEAN result;
268  U8BIT id;
269 
270  FUNCTION_START(ACFG_SetCountry);
271 
272  result = FALSE;
273 
274  for (id = 0; id < NUM_COUNTRIES; id++)
275  {
276  if (country_data_table[id].country_code == country_code)
277  {
278  /* Set this as the current country with default ids for the region and language */
279  ACFG_SetCountryIds(country_code, 0, 0, 0);
280  result = TRUE;
281  break;
282  }
283  }
284 
285  FUNCTION_FINISH(ACFG_SetCountry);
286 
287  return(result);
288 }
289 
297 void ACFG_SetCountryIds(U32BIT country_code, U8BIT region_id, U8BIT audio_lang_id, U8BIT sub_lang_id)
298 {
299  U8BIT country_id;
300  BOOLEAN country_changed;
301  BOOLEAN nvm_changed;
302  U8BIT index;
303 #ifdef COMMON_INTERFACE
304  U8BIT *lang_ids;
305 #endif
306 
307  FUNCTION_START(ACFG_SetCountryIds);
308 
309  country_changed = FALSE;
310  nvm_changed = FALSE;
311 
312  for (country_id = 0; country_id < NUM_COUNTRIES; country_id++)
313  {
314  if (country_data_table[country_id].country_code == country_code)
315  {
316  if (country_code != APP_NvmRead(COUNTRY_CODE_NVM))
317  {
318  APP_NvmSave(COUNTRY_CODE_NVM, country_code, FALSE);
319 
320 #ifdef COMMON_INTERFACE
321  /* Update the host country */
322  CISetHostCountryCode(country_code);
323 #endif
324  country_changed = TRUE;
325  nvm_changed = TRUE;
326  }
327 
328  /* Update the aerial power option */
329  if (ACFG_GetAerialPowerOptionReqd(country_code))
330  {
331  if (APP_NvmRead(AERIAL_POWER_ON_NVM) != ACFG_GetDefaultAerialPower(country_code))
332  {
333  APP_NvmSave(AERIAL_POWER_ON_NVM, ACFG_GetDefaultAerialPower(country_code), FALSE);
334  nvm_changed = TRUE;
335  }
336  }
337  else
338  {
339  if (APP_NvmRead(AERIAL_POWER_ON_NVM) != FALSE)
340  {
341  APP_NvmSave(AERIAL_POWER_ON_NVM, FALSE, FALSE);
342  nvm_changed = TRUE;
343  }
344  }
345 
346  /* Set the private data specifier code for the selected country to ensure
347  * the correct SI descriptors are parsed. */
350 
351  /* Clear any existing user defined SI functions and set them for the selected country */
353 
354  if (country_data_table[country_id].si_descs != NULL)
355  {
356  for (index = 0; country_data_table[country_id].si_descs[index].table_id != 0x00; index++)
357  {
358  STB_SISetUserDefinedDescriptorFunction(country_data_table[country_id].si_descs[index].table_id,
359  country_data_table[country_id].si_descs[index].func);
360  }
361  }
362 
363  if (country_changed || (audio_lang_id != (U8BIT)APP_NvmRead(PRIMARY_AUDIO_LANG_NVM)))
364  {
365  APP_NvmSave(PRIMARY_AUDIO_LANG_NVM, (U32BIT)audio_lang_id, FALSE);
366 
367  /* Set audio language */
368  ADB_SetAudioLang(country_code, audio_lang_id);
369 
370 #ifdef COMMON_INTERFACE
371  /* Update the language code */
372  lang_ids = ACFG_GetDbLangId(country_code, audio_lang_id);
373 
374  CISetHostLanguageCode(ACFG_ConvertLangIdToCode(lang_ids[0]));
375 #endif
376 
377  nvm_changed = TRUE;
378  }
379 
380  if (country_changed || (sub_lang_id != (U8BIT)APP_NvmRead(PRIMARY_TEXT_LANG_NVM)))
381  {
382  APP_NvmSave(PRIMARY_TEXT_LANG_NVM, (U32BIT)sub_lang_id, FALSE);
383 
384  /* Set subtitle language */
385  ADB_SetTextLang(country_code, sub_lang_id);
386 
387  nvm_changed = TRUE;
388  }
389 
390  if (region_id != (U8BIT)APP_NvmRead(REGION_ID_NVM))
391  {
392  /* Save the region ID */
393  APP_NvmSave(REGION_ID_NVM, (U32BIT)region_id, FALSE);
394  nvm_changed = TRUE;
395  }
396 
397  if (nvm_changed)
398  {
399  /* Save all updated info to NVM */
401  }
402 
403  break;
404  }
405  }
406 
407  FUNCTION_FINISH(ACFG_SetCountryIds);
408 }
409 
415 void ACFG_SetPrimaryAudioLangId(U8BIT lang_id)
416 {
417  U32BIT country_code;
418 
419  FUNCTION_START(ACFG_SetPrimaryAudioLangId);
420 
421  if (lang_id != (U8BIT)APP_NvmRead(PRIMARY_AUDIO_LANG_NVM))
422  {
423  APP_NvmSave(PRIMARY_AUDIO_LANG_NVM, (U32BIT)lang_id, TRUE);
424 
425  /* Set audio and subtitle language */
426  country_code = ACFG_GetCountry();
427  if (GetCountryId(country_code) < NUM_COUNTRIES)
428  {
429  ADB_SetAudioLang(country_code, lang_id);
430  }
431  }
432 
433  FUNCTION_FINISH(ACFG_SetPrimaryAudioLangId);
434 }
435 
440 void ACFG_SetSecondaryAudioLangId(U8BIT lang_id)
441 {
442  U32BIT country_code;
443 
444  FUNCTION_START(ACFG_SetSecondaryAudioLangId);
445 
446  if (lang_id != (U8BIT)APP_NvmRead(SECONDARY_AUDIO_LANG_NVM))
447  {
448  APP_NvmSave(SECONDARY_AUDIO_LANG_NVM, (U32BIT)lang_id, TRUE);
449 
450  /* Set secondary audio language */
451  country_code = ACFG_GetCountry();
452  if (GetCountryId(country_code) < NUM_COUNTRIES)
453  {
454  ADB_SetSecondaryAudioLang(country_code, lang_id);
455  }
456  }
457 
458  FUNCTION_FINISH(ACFG_SetSecondaryAudioLangId);
459 }
460 
465 void ACFG_SetPrimaryTextLangId(U8BIT lang_id)
466 {
467  U32BIT country_code;
468 
469  FUNCTION_START(ACFG_SetPrimaryTextLangId);
470 
471  if (lang_id != (U8BIT)APP_NvmRead(PRIMARY_TEXT_LANG_NVM))
472  {
473  APP_NvmSave(PRIMARY_TEXT_LANG_NVM, (U32BIT)lang_id, TRUE);
474 
475  /* Set subtitle language */
476  country_code = ACFG_GetCountry();
477  if (GetCountryId(country_code) < NUM_COUNTRIES)
478  {
479  ADB_SetTextLang(country_code, lang_id);
480  }
481  }
482 
483  FUNCTION_FINISH(ACFG_SetPrimaryTextLangId);
484 }
485 
490 void ACFG_SetSecondaryTextLangId(U8BIT lang_id)
491 {
492  U32BIT country_code;
493 
494  FUNCTION_START(ACFG_SetSecondaryTextLangId);
495 
496  if (lang_id != (U8BIT)APP_NvmRead(SECONDARY_TEXT_LANG_NVM))
497  {
498  APP_NvmSave(SECONDARY_TEXT_LANG_NVM, (U32BIT)lang_id, TRUE);
499 
500  /* Set audio and subtitle language */
501  country_code = ACFG_GetCountry();
502  if (GetCountryId(country_code) < NUM_COUNTRIES)
503  {
504  ADB_SetSecondaryTextLang(country_code, lang_id);
505  }
506  }
507 
508  FUNCTION_FINISH(ACFG_SetSecondaryTextLangId);
509 }
510 
518 void ACFG_GetCountryList(U8BIT ***str_array_ptr, U8BIT *num_countries_ptr)
519 {
520  U8BIT **str_array;
521  U8BIT num_entries;
522  U8BIT i;
523 
524  FUNCTION_START(ACFG_GetCountryList);
525 
526  num_entries = NUM_COUNTRIES;
527  str_array = STB_AppGetMemory(num_entries * sizeof(U8BIT *));
528  if (str_array != NULL)
529  {
530  for (i = 0; i < num_entries; i++)
531  {
532  str_array[i] = (U8BIT *)country_data_table[i].country_name;
533  }
534  }
535  else
536  {
537  num_entries = 0;
538  }
539 
540  *str_array_ptr = str_array;
541  *num_countries_ptr = num_entries;
542 
543  FUNCTION_FINISH(ACFG_GetCountryList);
544 }
545 
551 void ACFG_ReleaseCountryList(U8BIT **str_array, U8BIT num_countries)
552 {
553  FUNCTION_START(ACFG_ReleaseCountryList);
554 
555  USE_UNWANTED_PARAM(num_countries);
556 
557  if (str_array != NULL)
558  {
559  STB_AppFreeMemory(str_array);
560  }
561 
562  FUNCTION_FINISH(ACFG_ReleaseCountryList);
563 }
564 
572 BOOLEAN ACFG_GetCountryConfig(U32BIT country_code, ACFG_COUNTRY_CONFIG *config)
573 {
574  BOOLEAN retval;
575  U8BIT country_id;
576 
577  FUNCTION_START(ACFG_GetCountryConfig);
578 
579  country_id = GetCountryId(country_code);
580  if ((config != NULL) && (country_id < NUM_COUNTRIES))
581  {
582  memcpy(config, &country_data_table[country_id], sizeof(ACFG_COUNTRY_CONFIG));
583  retval = TRUE;
584  }
585  else
586  {
587  retval = FALSE;
588  }
589 
590  FUNCTION_FINISH(ACFG_GetCountryConfig);
591 
592  return(retval);
593 }
594 
605 BOOLEAN ACFG_SetCountryConfig(U32BIT country_code, ACFG_COUNTRY_CONFIG *config)
606 {
607  BOOLEAN retval;
608  U8BIT country_id;
609 
610  FUNCTION_START(ACFG_SetCountryConfig);
611 
612  country_id = GetCountryId(country_code);
613  if ((config != NULL) && (country_id < NUM_COUNTRIES))
614  {
615  memcpy(&country_data_table[country_id], config, sizeof(ACFG_COUNTRY_CONFIG));
616 
617  if (ACFG_GetCountry() == country_code)
618  {
619  /* The country config that's been changed is the one that's selected;
620  * set it again so default values are applied based on the config values that have just been set */
621  ACFG_SetCountryIds(country_code, (U8BIT)APP_NvmRead(REGION_ID_NVM),
622  (U8BIT)APP_NvmRead(PRIMARY_AUDIO_LANG_NVM), (U8BIT)APP_NvmRead(PRIMARY_TEXT_LANG_NVM));
623  }
624 
625  retval = TRUE;
626  }
627  else
628  {
629  retval = FALSE;
630  }
631 
632  FUNCTION_FINISH(ACFG_SetCountryConfig);
633 
634  return(retval);
635 }
636 
642 U8BIT ACFG_GetNumRegions(U32BIT country_code)
643 {
644  U8BIT num_regions;
645  U8BIT country_id;
646 
647  FUNCTION_START(ACFG_GetNumRegions);
648 
649  num_regions = 0;
650 
651  country_id = GetCountryId(country_code);
652  if (country_id < NUM_COUNTRIES)
653  {
654  num_regions = country_data_table[country_id].num_regions;
655  }
656 
657  FUNCTION_FINISH(ACFG_GetNumRegions);
658 
659  return(num_regions);
660 }
661 
668 U8BIT ACFG_GetNumDbLanguages(U32BIT country_code)
669 {
670  U8BIT num_db_languages;
671  U8BIT country_id;
672 
673  FUNCTION_START(ACFG_GetNumDbLanguages);
674 
675  num_db_languages = 0;
676 
677  country_id = GetCountryId(country_code);
678  if (country_id < NUM_COUNTRIES)
679  {
680  num_db_languages = country_data_table[country_id].num_db_langs;
681  }
682 
683  FUNCTION_FINISH(ACFG_GetNumDbLanguages);
684 
685  return(num_db_languages);
686 }
687 
698 BOOLEAN ACFG_GetRegionList(U32BIT country_code, U8BIT ***str_array_ptr, U8BIT *num_regions_ptr)
699 {
700  BOOLEAN retval;
701  U8BIT num_regions;
702  U8BIT num_entries;
703  U8BIT **str_array;
704  U8BIT country_id;
705  ACFG_REGION_DATA *region_data;
706  U8BIT i;
707 
708  FUNCTION_START(ACFG_GetRegionList);
709 
710  retval = FALSE;
711  num_entries = 0;
712  str_array = NULL;
713 
714  country_id = GetCountryId(country_code);
715  if (country_id < NUM_COUNTRIES)
716  {
717  num_regions = country_data_table[country_id].num_regions;
718  region_data = country_data_table[country_id].region_data;
719  if ((num_regions != 0) && (region_data != NULL))
720  {
721  str_array = STB_AppGetMemory(num_regions * sizeof(U8BIT *));
722  if (str_array != NULL)
723  {
724  for (i = 0; i < num_regions; i++)
725  {
726  str_array[i] = region_data[i].name;
727  }
728 
729  num_entries = num_regions;
730  }
731  }
732  retval = TRUE;
733  }
734 
735  *str_array_ptr = str_array;
736  *num_regions_ptr = num_entries;
737 
738  FUNCTION_FINISH(ACFG_GetRegionList);
739  return(retval);
740 }
741 
747 void ACFG_ReleaseRegionList(U8BIT **str_array, U8BIT num_regions)
748 {
749  FUNCTION_START(ACFG_ReleaseRegionList);
750 
751  USE_UNWANTED_PARAM(num_regions);
752 
753  if (str_array != NULL)
754  {
755  STB_AppFreeMemory(str_array);
756  }
757 
758  FUNCTION_FINISH(ACFG_ReleaseRegionList);
759 }
760 
771 BOOLEAN ACFG_SetDbLanguages(U32BIT country_code, ACFG_LANGUAGE_IDS *languages, U8BIT num_languages)
772 {
773  BOOLEAN retval;
774  U8BIT country_id;
775  ACFG_LANGUAGE_IDS *lang_data;
776 
777  FUNCTION_START(ACFG_SetDbLanguages);
778 
779  retval = FALSE;
780 
781  country_id = GetCountryId(country_code);
782  if (country_id < NUM_COUNTRIES)
783  {
784  if (num_languages != 0)
785  {
786  lang_data = STB_AppGetMemory(num_languages * sizeof(ACFG_LANGUAGE_IDS));
787  if (lang_data != NULL)
788  {
789  memcpy(lang_data, languages, num_languages * sizeof(ACFG_LANGUAGE_IDS));
790 
791  country_data_table[country_id].num_db_langs = num_languages;
792  country_data_table[country_id].db_lang_data = lang_data;
793  retval = TRUE;
794  }
795  }
796  else
797  {
798  country_data_table[country_id].num_db_langs = num_languages;
799  country_data_table[country_id].db_lang_data = languages;
800  retval = TRUE;
801  }
802 
803  if (retval)
804  {
805  /* Check the language IDs that are set are still valid and reset to 0 if not */
806  if (ACFG_GetPrimaryAudioLangId() >= num_languages)
807  {
809  }
810 
811  if (ACFG_GetSecondaryAudioLangId() >= num_languages)
812  {
814  }
815 
816  if (ACFG_GetPrimaryTextLangId() >= num_languages)
817  {
819  }
820 
821  if (ACFG_GetSecondaryTextLangId() >= num_languages)
822  {
824  }
825  }
826  }
827 
828  FUNCTION_FINISH(ACFG_SetDbLanguages);
829 
830  return(retval);
831 }
832 
844 BOOLEAN ACFG_GetDbLangList(U32BIT country_code, U8BIT ***str_array_ptr, U8BIT *num_langs_ptr)
845 {
846  BOOLEAN retval;
847  U8BIT num_langs;
848  U8BIT num_entries;
849  U8BIT **str_array;
850  U8BIT country_id;
851  ACFG_LANGUAGE_IDS *lang_data;
852  U8BIT i;
853 
854  FUNCTION_START(ACFG_GetDbLangList);
855 
856  retval = FALSE;
857  num_entries = 0;
858  str_array = NULL;
859 
860  country_id = GetCountryId(country_code);
861  if (country_id < NUM_COUNTRIES)
862  {
863  num_langs = country_data_table[country_id].num_db_langs;
864  lang_data = country_data_table[country_id].db_lang_data;
865  if ((num_langs != 0) && (lang_data != NULL))
866  {
867  str_array = STB_AppGetMemory(num_langs * sizeof(U8BIT *));
868  if (str_array != NULL)
869  {
870  for (i = 0; i < num_langs; i++)
871  {
872  str_array[i] = (U8BIT *)language_strings[lang_data[i].language_id];
873  }
874  num_entries = num_langs;
875  }
876  }
877  retval = TRUE;
878  }
879 
880  *str_array_ptr = str_array;
881  *num_langs_ptr = num_entries;
882 
883  FUNCTION_FINISH(ACFG_GetDbLangList);
884 
885  return(retval);
886 }
887 
900 U8BIT* ACFG_GetDbLangId(U32BIT country_code, U8BIT lang_entry)
901 {
902  const U8BIT *lang_ids;
903  U8BIT country_id;
904  U8BIT num_langs;
905  ACFG_LANGUAGE_IDS *lang_data;
906 
907  FUNCTION_START(ACFG_GetDbLangId);
908 
909  lang_ids = NULL;
910 
911  country_id = GetCountryId(country_code);
912  if (country_id < NUM_COUNTRIES)
913  {
914  num_langs = country_data_table[country_id].num_db_langs;
915  lang_data = country_data_table[country_id].db_lang_data;
916  if ((num_langs != 0) && (lang_data != NULL) && (lang_entry < num_langs))
917  {
918  lang_ids = lang_data[lang_entry].ids;
919  }
920  }
921 
922  FUNCTION_FINISH(ACFG_GetDbLangId);
923  return (U8BIT*)lang_ids;
924 }
925 
931 U8BIT ACFG_ConvertLangCodeToId(U32BIT lang_code)
932 {
933  U8BIT lang_id;
934  U8BIT i;
935 
936  FUNCTION_START(ACFG_ConvertLangCodeToId);
937 
938  lang_id = ACFG_INVALID_LANG;
939  for (i = 0; i < ACFG_NUM_DB_LANGUAGES; i++)
940  {
941  if (db_lang_list[i] == lang_code)
942  {
943  lang_id = i;
944  break;
945  }
946  }
947 
948  FUNCTION_FINISH(ACFG_ConvertLangCodeToId);
949  return(lang_id);
950 }
951 
957 U32BIT ACFG_ConvertLangIdToCode(U8BIT lang)
958 {
959  U32BIT lang_code;
960 
961  FUNCTION_START(ACFG_ConvertLangIdToCode);
962 
963  if (lang < ACFG_NUM_DB_LANGUAGES)
964  {
965  lang_code = db_lang_list[lang];
966  }
967  else
968  {
969  lang_code = 0;
970  }
971  FUNCTION_FINISH(ACFG_ConvertLangIdToCode);
972  return(lang_code);
973 }
974 
980 void ACFG_ReleaseDbLangList(U8BIT **str_array, U8BIT num_langs)
981 {
982  FUNCTION_START(ACFG_ReleaseDbLangList);
983 
984  USE_UNWANTED_PARAM(num_langs);
985 
986  if (str_array != NULL)
987  {
988  STB_AppFreeMemory(str_array);
989  }
990 
991  FUNCTION_FINISH(ACFG_ReleaseDbLangList);
992 }
993 
1001 BOOLEAN ACFG_GetAnaRfChannelTable(U32BIT country_code, ACFG_ANA_RF_CHANNEL_DATA **rf_chan_data_ptr,
1002  U16BIT *num_entries_ptr)
1003 {
1004  BOOLEAN retval;
1005  U8BIT country_id;
1006 
1007  FUNCTION_START(ACFG_GetAnaRfChannelTable);
1008 
1009  retval = FALSE;
1010 
1011  country_id = GetCountryId(country_code);
1012  if (country_id < NUM_COUNTRIES)
1013  {
1014  *rf_chan_data_ptr = (ACFG_ANA_RF_CHANNEL_DATA *) country_data_table[country_id].ana_rf_channel_table_ptr;
1015  *num_entries_ptr = country_data_table[country_id].num_ana_rf_channels;
1016  retval = TRUE;
1017  }
1018 
1019  FUNCTION_FINISH(ACFG_GetAnaRfChannelTable);
1020  return(retval);
1021 }
1022 
1030 BOOLEAN ACFG_GetTerRfChannelTable(U32BIT country_code, ACFG_TER_RF_CHANNEL_DATA **rf_chan_data_ptr,
1031  U16BIT *num_entries_ptr)
1032 {
1033  BOOLEAN retval;
1034  U8BIT country_id;
1035 
1036  FUNCTION_START(ACFG_GetTerRfChannelTable);
1037 
1038  retval = FALSE;
1039 
1040  country_id = GetCountryId(country_code);
1041  if (country_id < NUM_COUNTRIES)
1042  {
1043  *rf_chan_data_ptr = (ACFG_TER_RF_CHANNEL_DATA *) country_data_table[country_id].ter_rf_channel_table_ptr;
1044  *num_entries_ptr = country_data_table[country_id].num_ter_rf_channels;
1045  retval = TRUE;
1046  }
1047 
1048  FUNCTION_FINISH(ACFG_GetTerRfChannelTable);
1049  return(retval);
1050 }
1051 
1059 BOOLEAN ACFG_GetCabRfChannelTable(U32BIT country_code, ACFG_CAB_RF_CHANNEL_DATA **rf_chan_data_ptr,
1060  U16BIT *num_entries_ptr)
1061 {
1062  BOOLEAN retval;
1063  U8BIT country_id;
1064 
1065  FUNCTION_START(ACFG_GetCabRfChannelTable);
1066 
1067  retval = FALSE;
1068 
1069  country_id = GetCountryId(country_code);
1070  if (country_id < NUM_COUNTRIES)
1071  {
1072  *rf_chan_data_ptr = country_data_table[country_id].cab_rf_channel_table_ptr;
1073  *num_entries_ptr = country_data_table[country_id].num_cab_rf_channels;
1074  retval = TRUE;
1075  }
1076 
1077  FUNCTION_FINISH(ACFG_GetCabRfChannelTable);
1078  return(retval);
1079 }
1080 
1086 void ACFG_SetCableChannelTable(ACFG_CAB_RF_CHANNEL_DATA *cable_channel_data, U16BIT number_channels)
1087 {
1088  U8BIT country_id;
1089 
1090  FUNCTION_START(ACFG_SetCableChannelTable);
1091 
1092  country_id = GetCountryId(APP_NvmRead(COUNTRY_CODE_NVM));
1093  if (country_id < NUM_COUNTRIES)
1094  {
1095  country_data_table[country_id].cab_rf_channel_table_ptr = cable_channel_data;
1096  country_data_table[country_id].num_cab_rf_channels = number_channels;
1097  }
1098 
1099  FUNCTION_FINISH(ACFG_SetCableChannelTable);
1100 }
1101 
1107 U32BIT ACFG_GetCountryCode(U8BIT country_id)
1108 {
1109  U32BIT code;
1110 
1111  FUNCTION_START(ACFG_GetCountryCode);
1112 
1113  code = 0;
1114 
1115  if (country_id < NUM_COUNTRIES)
1116  {
1117  code = country_data_table[country_id].country_code;
1118  }
1119 
1120  FUNCTION_FINISH(ACFG_GetCountryCode);
1121  return(code);
1122 }
1123 
1130 U32BIT ACFG_GetPrivateDataSpecifier(U32BIT country_code)
1131 {
1132  U32BIT code;
1133  U8BIT country_id;
1134 
1135  FUNCTION_START(ACFG_GetPrivateDataSpecifier);
1136 
1137  code = 0;
1138 
1139  country_id = GetCountryId(country_code);
1140  if (country_id < NUM_COUNTRIES)
1141  {
1142  code = country_data_table[country_id].private_data_specifier;
1143  }
1144 
1145  FUNCTION_FINISH(ACFG_GetPrivateDataSpecifier);
1146  return(code);
1147 }
1148 
1156 U16BIT ACFG_GetFirstUnallocatedLcn(U32BIT country_code, E_STB_DP_SIGNAL_TYPE tuner_type)
1157 {
1158  U16BIT lcn;
1159  U8BIT country_id;
1160 
1161  FUNCTION_START(ACFG_GetFirstUnallocatedLcn);
1162 
1163  lcn = 0;
1164 
1165  country_id = GetCountryId(country_code);
1166  if (country_id < NUM_COUNTRIES)
1167  {
1168  switch (tuner_type)
1169  {
1170  case SIGNAL_COFDM:
1171  lcn = country_data_table[country_id].terr_first_unallocated_lcn;
1172  break;
1173  case SIGNAL_QAM:
1174  lcn = country_data_table[country_id].cab_first_unallocated_lcn;
1175  break;
1176  case SIGNAL_QPSK:
1177  lcn = country_data_table[country_id].sat_first_unallocated_lcn;
1178  break;
1179  default:
1180  break;
1181  }
1182  }
1183 
1184  FUNCTION_FINISH(ACFG_GetFirstUnallocatedLcn);
1185  return(lcn);
1186 }
1187 
1195 U16BIT ACFG_GetLastUnallocatedLcn(U32BIT country_code, E_STB_DP_SIGNAL_TYPE tuner_type)
1196 {
1197  U16BIT lcn;
1198  U8BIT country_id;
1199 
1200  FUNCTION_START(ACFG_GetLastUnallocatedLcn);
1201 
1202  lcn = 0;
1203 
1204  country_id = GetCountryId(country_code);
1205  if (country_id < NUM_COUNTRIES)
1206  {
1207  switch (tuner_type)
1208  {
1209  case SIGNAL_COFDM:
1210  lcn = country_data_table[country_id].terr_last_unallocated_lcn;
1211  break;
1212  case SIGNAL_QAM:
1213  lcn = country_data_table[country_id].cab_last_unallocated_lcn;
1214  break;
1215  case SIGNAL_QPSK:
1216  lcn = country_data_table[country_id].sat_last_unallocated_lcn;
1217  break;
1218  default:
1219  break;
1220  }
1221  }
1222 
1223  FUNCTION_FINISH(ACFG_GetLastUnallocatedLcn);
1224  return(lcn);
1225 }
1226 
1234 BOOLEAN ACFG_GetWatershedTimes(U32BIT country_code, U16BIT *start_time, U16BIT *end_time)
1235 {
1236  BOOLEAN watershed_defined;
1237  U8BIT country_id;
1238 
1239  FUNCTION_START(ACFG_GetWatershedTimes);
1240 
1241  watershed_defined = FALSE;
1242 
1243  country_id = GetCountryId(country_code);
1244  if (country_id < NUM_COUNTRIES)
1245  {
1246  if ((country_data_table[country_id].start_watershed < 1440) &&
1247  (country_data_table[country_id].end_watershed < 1440))
1248  {
1249  *start_time = country_data_table[country_id].start_watershed;
1250  *end_time = country_data_table[country_id].end_watershed;
1251  watershed_defined = TRUE;
1252  }
1253  }
1254 
1255  FUNCTION_FINISH(ACFG_GetWatershedTimes);
1256 
1257  return(watershed_defined);
1258 }
1259 
1266 U16BIT ACFG_GetMinSatelliteScanFreq(U32BIT country_code)
1267 {
1268  U16BIT freq;
1269  U8BIT country_id;
1270 
1271  FUNCTION_START(ACFG_GetMinSatelliteScanFreq);
1272 
1273  freq = 0;
1274 
1275  country_id = GetCountryId(country_code);
1276  if (country_id < NUM_COUNTRIES)
1277  {
1278  freq = country_data_table[country_id].min_sat_freq;
1279  }
1280 
1281  FUNCTION_FINISH(ACFG_GetMinSatelliteScanFreq);
1282 
1283  return(freq);
1284 }
1285 
1292 U16BIT ACFG_GetMaxSatelliteScanFreq(U32BIT country_code)
1293 {
1294  U16BIT freq;
1295  U8BIT country_id;
1296 
1297  FUNCTION_START(ACFG_GetMaxSatelliteScanFreq);
1298 
1299  freq = 0;
1300 
1301  country_id = GetCountryId(country_code);
1302  if (country_id < NUM_COUNTRIES)
1303  {
1304  freq = country_data_table[country_id].max_sat_freq;
1305  }
1306 
1307  FUNCTION_FINISH(ACFG_GetMaxSatelliteScanFreq);
1308 
1309  return(freq);
1310 }
1311 
1318 U16BIT ACFG_GetSatelliteScanFreqInc(U32BIT country_code)
1319 {
1320  U16BIT inc;
1321  U8BIT country_id;
1322 
1323  FUNCTION_START(ACFG_GetSatelliteScanFreqInc);
1324 
1325  inc = 0;
1326 
1327  country_id = GetCountryId(country_code);
1328  if (country_id < NUM_COUNTRIES)
1329  {
1330  inc = country_data_table[country_id].sat_freq_inc;
1331  }
1332 
1333  FUNCTION_FINISH(ACFG_GetSatelliteScanFreqInc);
1334 
1335  return(inc);
1336 }
1337 
1344 U16BIT* ACFG_GetSatelliteScanSymbolRates(U32BIT country_code)
1345 {
1346  U16BIT *srates;
1347  U8BIT country_id;
1348 
1349  FUNCTION_START(ACFG_GetSatelliteScanSymbolRates);
1350 
1351  srates = NULL;
1352 
1353  country_id = GetCountryId(country_code);
1354  if (country_id < NUM_COUNTRIES)
1355  {
1356  srates = (U16BIT *)(country_data_table[country_id].sat_symbol_rates);
1357  }
1358 
1359  FUNCTION_FINISH(ACFG_GetSatelliteScanSymbolRates);
1360 
1361  return(srates);
1362 }
1363 
1370 U8BIT ACFG_GetSatelliteScanNumSymbolRates(U32BIT country_code)
1371 {
1372  U8BIT num;
1373  U8BIT country_id;
1374 
1375  FUNCTION_START(ACFG_GetSatelliteScanNumSymbolRates);
1376 
1377  num = 0;
1378 
1379  country_id = GetCountryId(country_code);
1380  if (country_id < NUM_COUNTRIES)
1381  {
1382  num = country_data_table[country_id].num_symbol_rates;
1383  }
1384 
1385  FUNCTION_FINISH(ACFG_GetSatelliteScanNumSymbolRates);
1386 
1387  return(num);
1388 }
1389 
1396 BOOLEAN ACFG_GetSatelliteScanDvbS2(U32BIT country_code)
1397 {
1398  BOOLEAN inc_dvbs2;
1399  U8BIT country_id;
1400 
1401  FUNCTION_START(ACFG_GetSatelliteScanDvbS2);
1402 
1403  inc_dvbs2 = FALSE;
1404 
1405  country_id = GetCountryId(country_code);
1406  if (country_id < NUM_COUNTRIES)
1407  {
1408  inc_dvbs2 = country_data_table[country_id].include_dvbs2;
1409  }
1410 
1411  FUNCTION_FINISH(ACFG_GetSatelliteScanDvbS2);
1412 
1413  return(inc_dvbs2);
1414 }
1415 
1422 BOOLEAN ACFG_GetAerialPowerOptionReqd(U32BIT country_code)
1423 {
1424  BOOLEAN retval;
1425  U8BIT country_id;
1426 
1427  FUNCTION_START(ACFG_GetAerialPowerOptionReqd);
1428 
1429  retval = FALSE;
1430 
1431  country_id = GetCountryId(country_code);
1432  if (country_id < NUM_COUNTRIES)
1433  {
1434  retval = country_data_table[country_id].aerial_power_option_reqd;
1435  }
1436 
1437  FUNCTION_FINISH(ACFG_GetAerialPowerOptionReqd);
1438  return(retval);
1439 }
1440 
1447 BOOLEAN ACFG_GetDefaultAerialPower(U32BIT country_code)
1448 {
1449  BOOLEAN retval;
1450  U8BIT country_id;
1451 
1452  FUNCTION_START(ACFG_GetDefaultAerialPower);
1453 
1454  retval = FALSE;
1455 
1456  country_id = GetCountryId(country_code);
1457  if (country_id < NUM_COUNTRIES)
1458  {
1459  retval = country_data_table[country_id].default_aerial_power;
1460  }
1461 
1462  FUNCTION_FINISH(ACFG_GetDefaultAerialPower);
1463  return(retval);
1464 }
1465 
1472 BOOLEAN ACFG_GetAerialTuningScreenReqd(U32BIT country_code)
1473 {
1474  BOOLEAN retval;
1475  U8BIT country_id;
1476 
1477  FUNCTION_START(ACFG_GetAerialTuningScreenReqd);
1478 
1479  retval = FALSE;
1480 
1481  country_id = GetCountryId(country_code);
1482  if (country_id < NUM_COUNTRIES)
1483  {
1484  retval = country_data_table[country_id].aerial_tuning_screen_reqd;
1485  }
1486 
1487  FUNCTION_FINISH(ACFG_GetAerialTuningScreenReqd);
1488  return(retval);
1489 }
1490 
1498 BOOLEAN ACFG_GetRegionCode(U32BIT country_code, U8BIT region_id, U8BIT *code_ptr)
1499 {
1500  BOOLEAN retval;
1501  U8BIT country_id;
1502 
1503  FUNCTION_START(ACFG_GetRegionCode);
1504 
1505  retval = FALSE;
1506 
1507  country_id = GetCountryId(country_code);
1508  if (country_id < NUM_COUNTRIES)
1509  {
1510  if (region_id < country_data_table[country_id].num_regions)
1511  {
1512  *code_ptr = country_data_table[country_id].region_data[region_id].code;
1513  retval = TRUE;
1514  }
1515  }
1516 
1517  FUNCTION_FINISH(ACFG_GetRegionCode);
1518  return(retval);
1519 }
1520 
1529 U8BIT* ACFG_GetEventContentTypes(U32BIT country_code)
1530 {
1531  const U8BIT *types;
1532  U8BIT country_id;
1533 
1534  FUNCTION_START(ACFG_GetEventContentTypes);
1535 
1536  country_id = GetCountryId(country_code);
1537  if (country_id < NUM_COUNTRIES)
1538  {
1539  types = country_data_table[country_id].event_content_types;
1540  }
1541  else
1542  {
1543  types = NULL;
1544  }
1545 
1546  FUNCTION_FINISH(ACFG_GetEventContentTypes);
1547 
1548  return (U8BIT*)types;
1549 }
1550 
1557 void ACFG_SetBackgroundSearchTime(U16BIT start_time, U16BIT end_time)
1558 {
1559  FUNCTION_START(ACFG_SetBackgroundSearchTime);
1560 
1561  if ((end_time > start_time) && (end_time < (24 * 60)))
1562  {
1563  APP_NvmSave(BACKGROUND_SEARCH_START_NVM, (U32BIT)start_time, FALSE);
1564  APP_NvmSave(BACKGROUND_SEARCH_END_NVM, (U32BIT)end_time, TRUE);
1565  }
1566 
1567  FUNCTION_FINISH(ACFG_SetBackgroundSearchTime);
1568 }
1569 
1575 void ACFG_GetBackgroundSearchTime(U16BIT *start_time, U16BIT *end_time)
1576 {
1577  FUNCTION_START(ACFG_GetBackgroundSearchTime);
1578 
1579  if (start_time != NULL)
1580  {
1581  *start_time = (U16BIT)APP_NvmRead(BACKGROUND_SEARCH_START_NVM);
1582  }
1583 
1584  if (end_time != NULL)
1585  {
1586  *end_time = (U16BIT)APP_NvmRead(BACKGROUND_SEARCH_END_NVM);
1587  }
1588 
1589  FUNCTION_FINISH(ACFG_GetBackgroundSearchTime);
1590 }
1591 
1596 void ACFG_SetBackgroundServiceSearch(BOOLEAN enabled)
1597 {
1598  FUNCTION_START(ACFG_SetBackgroundServiceSearch);
1599 
1600  APP_NvmSave(SERVICE_SEARCH_ENABLED_NVM, (U32BIT)enabled, TRUE);
1601 
1602  FUNCTION_FINISH(ACFG_SetBackgroundServiceSearch);
1603 }
1604 
1610 {
1611  BOOLEAN enabled;
1612 
1613  FUNCTION_START(ACFG_GetBackgroundServiceSearch);
1614 
1615  enabled = (BOOLEAN)APP_NvmRead(SERVICE_SEARCH_ENABLED_NVM);
1616 
1617  FUNCTION_FINISH(ACFG_GetBackgroundServiceSearch);
1618 
1619  return(enabled);
1620 }
1621 
1626 void ACFG_SetBackgroundSSUSearch(BOOLEAN enabled)
1627 {
1628  FUNCTION_START(ACFG_SetBackgroundSSUSearch);
1629 
1630  APP_NvmSave(SSU_SEARCH_ENABLED_NVM, (U32BIT)enabled, TRUE);
1631 
1632  FUNCTION_FINISH(ACFG_SetBackgroundSSUSearch);
1633 }
1634 
1640 {
1641  BOOLEAN enabled;
1642 
1643  FUNCTION_START(ACFG_GetBackgroundSSUSearch);
1644 
1645  enabled = (BOOLEAN)APP_NvmRead(SSU_SEARCH_ENABLED_NVM);
1646 
1647  FUNCTION_FINISH(ACFG_GetBackgroundSSUSearch);
1648 
1649  return(enabled);
1650 }
1651 
1657 {
1658  U8BIT country_id;
1659  BOOLEAN retval;
1660 
1661  FUNCTION_START(ACFG_IsNordigCountry);
1662 
1663  country_id = GetCountryId(APP_NvmRead(COUNTRY_CODE_NVM));
1664  if (country_id < NUM_COUNTRIES)
1665  {
1666  retval = country_data_table[country_id].nordig_compliant;
1667  }
1668  else
1669  {
1670  retval = FALSE;
1671  }
1672 
1673  FUNCTION_FINISH(ACFG_IsNordigCountry);
1674  return(retval);
1675 }
1676 
1683 BOOLEAN ACFG_IsNordigService(E_STB_DP_SIGNAL_TYPE tuner_type)
1684 {
1685  U8BIT country_id;
1686  BOOLEAN retval;
1687 
1688  FUNCTION_START(ACFG_IsNordigService);
1689 
1690  retval = FALSE;
1691 
1692  country_id = GetCountryId(APP_NvmRead(COUNTRY_CODE_NVM));
1693  if (country_id < NUM_COUNTRIES)
1694  {
1695  switch (tuner_type)
1696  {
1697  case SIGNAL_COFDM:
1698  retval = country_data_table[country_id].terr_nordig_service;
1699  break;
1700  case SIGNAL_QAM:
1701  retval = country_data_table[country_id].cab_nordig_service;
1702  break;
1703  case SIGNAL_QPSK:
1704  retval = country_data_table[country_id].sat_nordig_service;
1705  break;
1706  default:
1707  break;
1708  }
1709  }
1710 
1711  FUNCTION_FINISH(ACFG_IsNordigService);
1712 
1713  return(retval);
1714 }
1715 
1722 {
1723  U8BIT retval = 0;
1724  U8BIT country_id;
1725 
1726  FUNCTION_START(ACFG_GetEitSearchesPerDay);
1727 
1728  country_id = GetCountryId(APP_NvmRead(COUNTRY_CODE_NVM));
1729  if (country_id < NUM_COUNTRIES)
1730  {
1731  retval = country_data_table[country_id].eit_searches_per_day;
1732  }
1733 
1734  FUNCTION_FINISH(ACFG_GetEitSearchesPerDay);
1735 
1736  return retval;
1737 }
1738 
1745 {
1746  U8BIT retval = 0;
1747  U8BIT country_id;
1748 
1749  FUNCTION_START(ACFG_GetEitUpdateTime);
1750 
1751  country_id = GetCountryId(APP_NvmRead(COUNTRY_CODE_NVM));
1752  if (country_id < NUM_COUNTRIES)
1753  {
1754  retval = country_data_table[country_id].eit_update_time;
1755  }
1756 
1757  FUNCTION_FINISH(ACFG_GetEitUpdateTime);
1758 
1759  return retval;
1760 }
1761 
1768 AllocLcnFunc ACFG_GetTerrestrialLcnFunction(U32BIT country_code)
1769 {
1770  AllocLcnFunc func_ptr;
1771  U8BIT country_id;
1772 
1773  FUNCTION_START(ACFG_GetTerrestrialLcnFunction);
1774 
1775  country_id = GetCountryId(country_code);
1776  if (country_id < NUM_COUNTRIES)
1777  {
1778  func_ptr = country_data_table[country_id].terr_lcn_func;
1779  }
1780  else
1781  {
1782  func_ptr = NULL;
1783  }
1784 
1785  FUNCTION_FINISH(ACFG_GetTerrestrialLcnFunction);
1786 
1787  return(func_ptr);
1788 }
1789 
1795 void ACFG_SetTerrestrialLcnFunction(U32BIT country_code, AllocLcnFunc func_ptr)
1796 {
1797  U8BIT country_id;
1798 
1799  FUNCTION_START(ACFG_SetTerrestrialLcnFunction);
1800 
1801  country_id = GetCountryId(country_code);
1802  if (country_id < NUM_COUNTRIES)
1803  {
1804  country_data_table[country_id].terr_lcn_func = func_ptr;
1805  }
1806 
1807  FUNCTION_FINISH(ACFG_SetTerrestrialLcnFunction);
1808 }
1809 
1816 AllocLcnFunc ACFG_GetCableLcnFunction(U32BIT country_code)
1817 {
1818  AllocLcnFunc func_ptr;
1819  U8BIT country_id;
1820 
1821  FUNCTION_START(ACFG_GetCableLcnFunction);
1822 
1823  country_id = GetCountryId(country_code);
1824  if (country_id < NUM_COUNTRIES)
1825  {
1826  func_ptr = country_data_table[country_id].cab_lcn_func;
1827  }
1828  else
1829  {
1830  func_ptr = NULL;
1831  }
1832 
1833  FUNCTION_FINISH(ACFG_GetCableLcnFunction);
1834 
1835  return(func_ptr);
1836 }
1837 
1843 void ACFG_SetCableLcnFunction(U32BIT country_code, AllocLcnFunc func_ptr)
1844 {
1845  U8BIT country_id;
1846 
1847  FUNCTION_START(ACFG_SetCableLcnFunction);
1848 
1849  country_id = GetCountryId(country_code);
1850  if (country_id < NUM_COUNTRIES)
1851  {
1852  country_data_table[country_id].cab_lcn_func = func_ptr;
1853  }
1854 
1855  FUNCTION_FINISH(ACFG_SetCableLcnFunction);
1856 }
1857 
1864 AllocLcnFunc ACFG_GetSatelliteLcnFunction(U32BIT country_code)
1865 {
1866  AllocLcnFunc func_ptr;
1867  U8BIT country_id;
1868 
1869  FUNCTION_START(ACFG_GetSatelliteLcnFunction);
1870 
1871  country_id = GetCountryId(country_code);
1872  if (country_id < NUM_COUNTRIES)
1873  {
1874  func_ptr = country_data_table[country_id].sat_lcn_func;
1875  }
1876  else
1877  {
1878  func_ptr = NULL;
1879  }
1880 
1881  FUNCTION_FINISH(ACFG_GetSatelliteLcnFunction);
1882 
1883  return(func_ptr);
1884 }
1885 
1891 void ACFG_SetSatelliteLcnFunction(U32BIT country_code, AllocLcnFunc func_ptr)
1892 {
1893  U8BIT country_id;
1894 
1895  FUNCTION_START(ACFG_SetSatelliteLcnFunction);
1896 
1897  country_id = GetCountryId(country_code);
1898  if (country_id < NUM_COUNTRIES)
1899  {
1900  country_data_table[country_id].sat_lcn_func = func_ptr;
1901  }
1902 
1903  FUNCTION_FINISH(ACFG_SetSatelliteLcnFunction);
1904 }
1905 
1912 DBTidyFunc ACFG_GetTerrestrialDBTidyFunction(U32BIT country_code)
1913 {
1914  DBTidyFunc func_ptr;
1915  U8BIT country_id;
1916 
1917  FUNCTION_START(ACFG_GetTerrestrialDBTidyFunction);
1918 
1919  country_id = GetCountryId(country_code);
1920  if (country_id < NUM_COUNTRIES)
1921  {
1922  func_ptr = country_data_table[country_id].terr_db_tidy_func;
1923  }
1924  else
1925  {
1926  func_ptr = NULL;
1927  }
1928 
1929  FUNCTION_FINISH(ACFG_GetTerrestrialDBTidyFunction);
1930 
1931  return(func_ptr);
1932 }
1933 
1940 DBTidyFunc ACFG_GetCableDBTidyFunction(U32BIT country_code)
1941 {
1942  DBTidyFunc func_ptr;
1943  U8BIT country_id;
1944 
1945  FUNCTION_START(ACFG_GetCableDBTidyFunction);
1946 
1947  country_id = GetCountryId(country_code);
1948  if (country_id < NUM_COUNTRIES)
1949  {
1950  func_ptr = country_data_table[country_id].cab_db_tidy_func;
1951  }
1952  else
1953  {
1954  func_ptr = NULL;
1955  }
1956 
1957  FUNCTION_FINISH(ACFG_GetCableDBTidyFunction);
1958 
1959  return(func_ptr);
1960 }
1961 
1968 DBTidyFunc ACFG_GetSatelliteDBTidyFunction(U32BIT country_code)
1969 {
1970  DBTidyFunc func_ptr;
1971  U8BIT country_id;
1972 
1973  FUNCTION_START(ACFG_GetSatelliteDBTidyFunction);
1974 
1975  country_id = GetCountryId(country_code);
1976  if (country_id < NUM_COUNTRIES)
1977  {
1978  func_ptr = country_data_table[country_id].sat_db_tidy_func;
1979  }
1980  else
1981  {
1982  func_ptr = NULL;
1983  }
1984 
1985  FUNCTION_FINISH(ACFG_GetSatelliteDBTidyFunction);
1986 
1987  return(func_ptr);
1988 }
1989 
1998 {
1999  U8BIT retval = ACFG_INVALID_LANG;
2000  U8BIT country_id;
2001 
2002  FUNCTION_START(ACFG_GetDefaultSecondaryLangId);
2003 
2004  country_id = GetCountryId(APP_NvmRead(COUNTRY_CODE_NVM));
2005  if (country_id < NUM_COUNTRIES)
2006  {
2007  retval = country_data_table[country_id].default_secondary_language;
2008  }
2009 
2010  FUNCTION_FINISH(ACFG_GetDefaultSecondaryLangId);
2011 
2012  return retval;
2013 }
2014 
2015 static U8BIT GetCountryId(U32BIT country_code)
2016 {
2017  U8BIT id;
2018 
2019  FUNCTION_START(GetCountryId);
2020 
2021  for (id = 0; id < NUM_COUNTRIES; id++)
2022  {
2023  if (country_data_table[id].country_code == country_code)
2024  {
2025  break;
2026  }
2027  }
2028 
2029  FUNCTION_FINISH(GetCountryId);
2030 
2031  return(id);
2032 }
2033 
2042 {
2043  U8BIT lang_id;
2044 
2045  FUNCTION_START(ACFG_SetUndefinedLanguageBehaviour);
2046 
2047  lang_id = ACFG_ConvertLangCodeToId(lang_code);
2048  if ((lang_id != ACFG_INVALID_DB_LANG) || (lang_code == ADB_LANG_CODE_UNDEF))
2049  {
2050  und_lang_code = lang_code;
2051  }
2052 
2053  FUNCTION_FINISH(ACFG_SetUndefinedLanguageBehaviour);
2054 }
2055 
2062 {
2063  FUNCTION_START(ACFG_GetUndefinedLanguageBehaviour);
2064  FUNCTION_FINISH(ACFG_GetUndefinedLanguageBehaviour);
2065  return (und_lang_code);
2066 }
2067 
2073 {
2074  FUNCTION_START(ACFG_SetHostCountryLanguageModuleId);
2075 #ifdef COMMON_INTERFACE
2076  ci_hcl_module = module;
2077 #else
2078  USE_UNWANTED_PARAM(module);
2079 #endif
2080  FUNCTION_FINISH(ACFG_SetHostCountryLanguageModuleId);
2081 }
2082 
2092 BOOLEAN ACFG_GetDynamicSIUpdate(E_STB_DP_SIGNAL_TYPE signal_type, U16BIT onet_id,
2093  E_ACFG_DYNAMIC_SI_UPDATE_TYPE update_type)
2094 {
2095  BOOLEAN enabled;
2096  U8BIT country_id;
2097  ACFG_DYNAMIC_SI_UPDATES *si_updates;
2098  U8BIT index;
2099 
2100  FUNCTION_START(ACFG_GetDynamicSIUpdate);
2101 
2102  enabled = FALSE;
2103 
2104  country_id = GetCountryId(APP_NvmRead(COUNTRY_CODE_NVM));
2105  if (country_id < NUM_COUNTRIES)
2106  {
2107  switch (signal_type)
2108  {
2109  case SIGNAL_COFDM:
2110  si_updates = country_data_table[country_id].terr_dynamic_si_updates;
2111  break;
2112  case SIGNAL_QAM:
2113  si_updates = country_data_table[country_id].cab_dynamic_si_updates;
2114  break;
2115  case SIGNAL_QPSK:
2116  si_updates = country_data_table[country_id].sat_dynamic_si_updates;
2117  break;
2118  default:
2119  si_updates = NULL;
2120  break;
2121  }
2122 
2123  if (si_updates != NULL)
2124  {
2125  for (index = 0; si_updates[index].update_types != ACFG_DYNAMIC_SI_UPDATE_NONE; index++)
2126  {
2127  if ((si_updates[index].original_network_id == ADB_INVALID_DVB_ID) ||
2128  (si_updates[index].original_network_id == onet_id))
2129  {
2130  /* Found the required dynamic SI update settings */
2131  if ((si_updates[index].update_types & update_type) != 0)
2132  {
2133  enabled = TRUE;
2134  }
2135  break;
2136  }
2137  }
2138  }
2139  }
2140 
2141  FUNCTION_FINISH(ACFG_GetDynamicSIUpdate);
2142 
2143  return(enabled);
2144 }
2145 
2156 BOOLEAN ACFG_SetDynamicSIUpdates(E_STB_DP_SIGNAL_TYPE signal_type, ACFG_DYNAMIC_SI_UPDATES *dynamic_updates,
2157  U8BIT num_updates)
2158 {
2159  BOOLEAN retval;
2160  U8BIT country_id;
2161  ACFG_DYNAMIC_SI_UPDATES **si_updates;
2162 
2163  FUNCTION_START(ACFG_SetDynamicSIUpdates);
2164 
2165  retval = FALSE;
2166 
2167  country_id = GetCountryId(APP_NvmRead(COUNTRY_CODE_NVM));
2168  if (country_id < NUM_COUNTRIES)
2169  {
2170  switch (signal_type)
2171  {
2172  case SIGNAL_COFDM:
2173  si_updates = &country_data_table[country_id].terr_dynamic_si_updates;
2174  break;
2175  case SIGNAL_QAM:
2176  si_updates = &country_data_table[country_id].cab_dynamic_si_updates;
2177  break;
2178  case SIGNAL_QPSK:
2179  si_updates = &country_data_table[country_id].sat_dynamic_si_updates;
2180  break;
2181  default:
2182  si_updates = NULL;
2183  break;
2184  }
2185 
2186  if (si_updates != NULL)
2187  {
2188  *si_updates = (ACFG_DYNAMIC_SI_UPDATES *)STB_AppGetMemory(num_updates * sizeof(ACFG_DYNAMIC_SI_UPDATES));
2189  if (*si_updates != NULL)
2190  {
2191  memcpy(*si_updates, dynamic_updates, num_updates * sizeof(ACFG_DYNAMIC_SI_UPDATES));
2192  retval = TRUE;
2193  }
2194  }
2195  }
2196 
2197  FUNCTION_FINISH(ACFG_SetDynamicSIUpdates);
2198 
2199  return(retval);
2200 }
2201 
DBTidyFunc ACFG_GetTerrestrialDBTidyFunction(U32BIT country_code)
Returns a pointer to a function that&#39;s used to tidy up the database following a DVB-T/T2 scan for the...
Definition: ap_cfg.c:1912
U16BIT ACFG_GetMinSatelliteScanFreq(U32BIT country_code)
Returns the minimum frequency to be used when performing a satellite based frequency scan in the give...
Definition: ap_cfg.c:1266
U32BIT ACFG_GetCountry(void)
Returns the country code the DVB is configured for.
Definition: ap_cfg.c:150
U16BIT ACFG_GetLastUnallocatedLcn(U32BIT country_code, E_STB_DP_SIGNAL_TYPE tuner_type)
Returns the last LCN that should be used when assigning LCNs to services that don&#39;t appear in an LCN ...
Definition: ap_cfg.c:1195
BOOLEAN ACFG_SetCountryConfig(U32BIT country_code, ACFG_COUNTRY_CONFIG *config)
Sets the country configuration settings that will be used for given country. This could be used to ov...
Definition: ap_cfg.c:605
Application configuration.
Application database control.
Header file - macros and function prototypes for public use.
AllocLcnFunc ACFG_GetTerrestrialLcnFunction(U32BIT country_code)
Returns a pointer to a function that&#39;s used to assign LCNs following a DVB-T/T2 scan for the given co...
Definition: ap_cfg.c:1768
BOOLEAN ACFG_GetBackgroundServiceSearch(void)
Returns whether the background service search is enabled or not.
Definition: ap_cfg.c:1609
U8BIT ACFG_GetEitSearchesPerDay(void)
Returns the number of EIT searches that should be performed per day when the box is in standby...
Definition: ap_cfg.c:1721
Header file for NVM data handling functions.
void * STB_AppGetMemory(U32BIT bytes)
Attempts to allocate memory from the application heap.
Definition: stbheap.c:651
void ACFG_SetSatelliteLcnFunction(U32BIT country_code, AllocLcnFunc func_ptr)
Overrides an existing DVB-S/S2 LCN allocation function for the given country.
Definition: ap_cfg.c:1891
void ACFG_GetCountryList(U8BIT ***str_array_ptr, U8BIT *num_countries_ptr)
Returns an array containing the names of all the countries included in the DVB. The index into this a...
Definition: ap_cfg.c:518
void STB_SISetCountryPrivateDataSpecifier(U32BIT code)
Sets the country specific private data specifier code that will be used when parsing SI tables...
Definition: stbsitab.c:7630
AllocLcnFunc ACFG_GetSatelliteLcnFunction(U32BIT country_code)
Returns a pointer to a function that&#39;s used to assign LCNs following a DVB-S/S2 scan for the given co...
Definition: ap_cfg.c:1864
BOOLEAN ACFG_GetDynamicSIUpdate(E_STB_DP_SIGNAL_TYPE signal_type, U16BIT onet_id, E_ACFG_DYNAMIC_SI_UPDATE_TYPE update_type)
Use to check whether a dynamic SI update type is enabled for the currently configured country and giv...
Definition: ap_cfg.c:2092
U8BIT * ACFG_GetEventContentTypes(U32BIT country_code)
Returns the event content types for the given country. This defines how the content type value broadc...
Definition: ap_cfg.c:1529
void ACFG_SetCountryIds(U32BIT country_code, U8BIT region_id, U8BIT audio_lang_id, U8BIT sub_lang_id)
Saves the configured country and changes settings related to the country.
Definition: ap_cfg.c:297
U8BIT ACFG_GetSecondaryAudioLangId(void)
Returns the secondary audio language ID.
Definition: ap_cfg.c:219
U8BIT * ACFG_GetDbLangId(U32BIT country_code, U8BIT lang_entry)
Returns an array of language ids for a given country and index into the language array. A language id is one of the ACFG_DB_LANG_XXXX values above and there might be more than one for a given language. For example german language has two ids associated to it: ACFG_DB_LANG_GERMAN1 and ACFG_DB_LANG_GERMAN2 because german language can have two different codes, &#39;deu&#39; and &#39;ger&#39;. See also functions ACFG_ConvertLangIdToCode and ACFG_ConvertLangCodeToId. The returned pointer is an internal array and must not be freed.
Definition: ap_cfg.c:900
void STB_SIClearUserDefinedDescriptorFunctions(void)
Clear all entries in the user defined SI descriptor table.
Definition: stbsitab.c:7745
U32BIT APP_NvmRead(E_NVM_ITEMS nvm_item)
Returns the current value for the given DVB setting.
Definition: app_nvm.c:562
BOOLEAN ACFG_GetRegionList(U32BIT country_code, U8BIT ***str_array_ptr, U8BIT *num_regions_ptr)
Returns an array of pointers to strings containing the region names for the given country...
Definition: ap_cfg.c:698
void ACFG_ReleaseDbLangList(U8BIT **str_array, U8BIT num_langs)
Frees the language array previously acquired using ACFG_GetDbLangList.
Definition: ap_cfg.c:980
void ACFG_GetBackgroundSearchTime(U16BIT *start_time, U16BIT *end_time)
Gets the background start and end search times.
Definition: ap_cfg.c:1575
void ACFG_SetHostCountryLanguageModuleId(U32BIT module)
Sets the host and country module for CI stack. Value zero for disable.
Definition: ap_cfg.c:2072
Application timer functions and defines.
void APP_NvmSave(E_NVM_ITEMS nvm_item, U32BIT new_value, BOOLEAN write_to_flash_now)
Sets the current value for the given DVB setting.
Definition: app_nvm.c:634
BOOLEAN ACFG_SetCountry(U32BIT country_code)
Sets the current country and sets default values for region and language.
Definition: ap_cfg.c:265
U8BIT ACFG_GetNumRegions(U32BIT country_code)
Returns the number of regions in the given country.
Definition: ap_cfg.c:642
BOOLEAN ACFG_SetDbLanguages(U32BIT country_code, ACFG_LANGUAGE_IDS *languages, U8BIT num_languages)
Sets the languages that can be used for setting the default primary and secondary audio...
Definition: ap_cfg.c:771
U32BIT ACFG_GetCountryCode(U8BIT country_id)
Returns the country code for the given country index.
Definition: ap_cfg.c:1107
DBTidyFunc ACFG_GetCableDBTidyFunction(U32BIT country_code)
Returns a pointer to a function that&#39;s used to tidy up the database following a DVB-C scan for the gi...
Definition: ap_cfg.c:1940
void ACFG_SetPrimaryTextLangId(U8BIT lang_id)
Sets the primary language id to be used for teletext/subtitles.
Definition: ap_cfg.c:465
void ACFG_SetSecondaryTextLangId(U8BIT lang_id)
Sets the secondary language id to be used for teletext/subtitles.
Definition: ap_cfg.c:490
BOOLEAN ACFG_GetAnaRfChannelTable(U32BIT country_code, ACFG_ANA_RF_CHANNEL_DATA **rf_chan_data_ptr, U16BIT *num_entries_ptr)
Returns a pointer to the channel table for an analog tuner for the given country. ...
Definition: ap_cfg.c:1001
BOOLEAN ACFG_GetBackgroundSSUSearch(void)
Returns whether the background SSU search is enabled or not.
Definition: ap_cfg.c:1639
void ACFG_SetBackgroundServiceSearch(BOOLEAN enabled)
Enables or disables the background service search when in standby.
Definition: ap_cfg.c:1596
void STB_SISetUserDefinedDescriptorFunction(U8BIT dtag, STB_SI_USER_DEF_DESCRIP_FUNCTION func)
Sets the function allocated to the user defined descriptor.
Definition: stbsitab.c:7717
U8BIT ACFG_ConvertLangCodeToId(U32BIT lang_code)
Returns the language id for the given language code.
Definition: ap_cfg.c:931
U8BIT ACFG_GetPrimaryTextLangId(void)
Returns the primary DVB subtitle/teletext language ID.
Definition: ap_cfg.c:234
U32BIT ACFG_GetUndefinedLanguageBehaviour(void)
Gets the language code set by ACFG_SetUndefinedLanguageBehaviour, or &#39;und&#39; if that function has not b...
Definition: ap_cfg.c:2061
U8BIT ACFG_GetNumCountries(void)
Returns the number of country configurations included in the DVB stack.
Definition: ap_cfg.c:139
void ACFG_SetBackgroundSSUSearch(BOOLEAN enabled)
Enables or disables the background SSU search when in standby.
Definition: ap_cfg.c:1626
Debug functions header file.
Header file - Function prototypes for linked lists.
Header file - macros and function prototypes for public use.
BOOLEAN ACFG_GetRegionCode(U32BIT country_code, U8BIT region_id, U8BIT *code_ptr)
Returns the region code that identifies the given region.
Definition: ap_cfg.c:1498
BOOLEAN ACFG_GetAerialTuningScreenReqd(U32BIT country_code)
Returns whether an aerial tuning screen should be presented by the interface before performing a DVB-...
Definition: ap_cfg.c:1472
void ADB_SetTextLang(U32BIT country_code, U8BIT lang_id)
Sets the primary subtitle and teletext language to be used.
Definition: ap_dbacc.c:7538
Application configuration data.
void ACFG_SetUndefinedLanguageBehaviour(U32BIT lang_code)
Sets the language code to be used when the SI descriptors contain &#39;und&#39;, &#39;qaa&#39; or don&#39;t contain any l...
Definition: ap_cfg.c:2041
BOOLEAN ACFG_IsNordigService(E_STB_DP_SIGNAL_TYPE tuner_type)
Returns whether the broadcast SI data for the given tuner type is to be treated as Nordig compliant...
Definition: ap_cfg.c:1683
U16BIT * ACFG_GetSatelliteScanSymbolRates(U32BIT country_code)
Returns a fixed array of symbol rates to be used when performing a satellite based frequency scan in ...
Definition: ap_cfg.c:1344
U16BIT ACFG_GetFirstUnallocatedLcn(U32BIT country_code, E_STB_DP_SIGNAL_TYPE tuner_type)
Returns the first LCN that should be used when assigning LCNs to services that don&#39;t appear in an LCN...
Definition: ap_cfg.c:1156
BOOLEAN ACFG_GetSatelliteScanDvbS2(U32BIT country_code)
Returns whether DVB-S2 should be included when performing a satellite based frequency scan in the giv...
Definition: ap_cfg.c:1396
BOOLEAN ACFG_GetWatershedTimes(U32BIT country_code, U16BIT *start_time, U16BIT *end_time)
Get the start and end times of the watershed hours for a country.
Definition: ap_cfg.c:1234
void ADB_SetAudioLang(U32BIT country_code, U8BIT lang_id)
Sets the primary audio language to be used.
Definition: ap_dbacc.c:7493
DBTidyFunc ACFG_GetSatelliteDBTidyFunction(U32BIT country_code)
Returns a pointer to a function that&#39;s used to tidy up the database following a DVB-S/S2 scan for the...
Definition: ap_cfg.c:1968
U8BIT ACFG_GetSecondaryTextLangId(void)
Returns the secondary DVB subtitle/teletext language ID.
Definition: ap_cfg.c:249
void ACFG_SetPrimaryAudioLangId(U8BIT lang_id)
Sets the primary language id to be used for audio. This is the language that will be chosen first...
Definition: ap_cfg.c:415
BOOLEAN ACFG_GetCabRfChannelTable(U32BIT country_code, ACFG_CAB_RF_CHANNEL_DATA **rf_chan_data_ptr, U16BIT *num_entries_ptr)
Returns a pointer to the channel table for a cable tuner for the given country.
Definition: ap_cfg.c:1059
BOOLEAN ACFG_GetAerialPowerOptionReqd(U32BIT country_code)
Returns whether the aerial power option is required for DVB-T/T2 for the given country.
Definition: ap_cfg.c:1422
void ACFG_SetCableChannelTable(ACFG_CAB_RF_CHANNEL_DATA *cable_channel_data, U16BIT number_channels)
Replaces the cable tuning table for the current country with the one provided.
Definition: ap_cfg.c:1086
System Wide Global Technical Data Type Definitions.
void ACFG_SetCableLcnFunction(U32BIT country_code, AllocLcnFunc func_ptr)
Overrides an existing DVB-C LCN allocation function for the given country.
Definition: ap_cfg.c:1843
void STB_AppFreeMemory(void *addr)
Releases previously allocated application heap memory.
Definition: stbheap.c:781
void ADB_SetSecondaryAudioLang(U32BIT country_code, U8BIT lang_id)
Sets the secondary audio language to be used. This will be selected if the primary audio language isn...
Definition: ap_dbacc.c:7516
void ACFG_SetSecondaryAudioLangId(U8BIT lang_id)
Sets the secondary language id to be used for audio.
Definition: ap_cfg.c:440
BOOLEAN ACFG_IsNordigCountry(void)
Returns whether the current country requires Nordig compliance for SI.
Definition: ap_cfg.c:1656
void STB_SISetNordigPrivateDataSpecifierMode(BOOLEAN mode)
Enables or disables use of the Nordig private data specifier when parsing SI tables.
Definition: stbsitab.c:7696
void ACFG_SetTerrestrialLcnFunction(U32BIT country_code, AllocLcnFunc func_ptr)
Overrides an existing DVB-T/T2 LCN allocation function for the given country.
Definition: ap_cfg.c:1795
void ACFG_ReleaseCountryList(U8BIT **str_array, U8BIT num_countries)
Frees a country list previously acquired using ACFG_GetCountryList.
Definition: ap_cfg.c:551
U32BIT ACFG_GetPrivateDataSpecifier(U32BIT country_code)
Returns the private data specifier value for the given country.
Definition: ap_cfg.c:1130
Definition: ap_cfg.h:325
void ADB_SetSecondaryTextLang(U32BIT country_code, U8BIT lang_id)
Sets the secondary subtitle and teletext language to be used. This will be used if the primary langua...
Definition: ap_dbacc.c:7561
AllocLcnFunc ACFG_GetCableLcnFunction(U32BIT country_code)
Returns a pointer to a function that&#39;s used to assign LCNs following a DVB-C scan for the given count...
Definition: ap_cfg.c:1816
Header file - Function prototypes for heap memory.
U8BIT ACFG_GetDefaultSecondaryLangId(void)
Returns the default secondary language for audio and subtitles as defined for the selected country...
Definition: ap_cfg.c:1997
U8BIT ACFG_GetSatelliteScanNumSymbolRates(U32BIT country_code)
Returns the number of items in the fixed array of symbol rates to be used when performing a satellite...
Definition: ap_cfg.c:1370
Application header file.
U8BIT ACFG_GetNumDbLanguages(U32BIT country_code)
Returns the number of languages defined for the given country that can be used for audio and subtitle...
Definition: ap_cfg.c:668
BOOLEAN ACFG_SetDynamicSIUpdates(E_STB_DP_SIGNAL_TYPE signal_type, ACFG_DYNAMIC_SI_UPDATES *dynamic_updates, U8BIT num_updates)
Sets the dynamic SI updates for the given tuner type of the currently configured country.
Definition: ap_cfg.c:2156
void APP_NvmSaveAllNow(void)
Saves DVB values immediately.
Definition: app_nvm.c:750
BOOLEAN ACFG_GetDefaultAerialPower(U32BIT country_code)
Returns the default aerial power option setting for DVB-T/T2 for the given country.
Definition: ap_cfg.c:1447
U32BIT ACFG_ConvertLangIdToCode(U8BIT lang)
Returns the language code for the given language id.
Definition: ap_cfg.c:957
U8BIT ACFG_GetCountryIndex(U32BIT country_code)
Returns the index in the list of countries known by the DVB, of the given country.
Definition: ap_cfg.c:166
BOOLEAN ACFG_GetCountryConfig(U32BIT country_code, ACFG_COUNTRY_CONFIG *config)
Copies the country configuration for the given country into the provided structure. None of the included arrays should be freed.
Definition: ap_cfg.c:572
U8BIT ACFG_GetEitUpdateTime(void)
Returns the number of minutes after which all the events should have been received during an EIT sear...
Definition: ap_cfg.c:1744
U8BIT ACFG_GetPrimaryAudioLangId(void)
Returns the primary audio language ID.
Definition: ap_cfg.c:204
BOOLEAN ACFG_GetTerRfChannelTable(U32BIT country_code, ACFG_TER_RF_CHANNEL_DATA **rf_chan_data_ptr, U16BIT *num_entries_ptr)
Returns a pointer to the channel table for a terrestrial tuner for the given country.
Definition: ap_cfg.c:1030
U16BIT ACFG_GetMaxSatelliteScanFreq(U32BIT country_code)
Returns the maximum frequency to be used when performing a satellite based frequency scan in the give...
Definition: ap_cfg.c:1292
void ACFG_ReleaseRegionList(U8BIT **str_array, U8BIT num_regions)
Frees the region array previously acquired using ACFG_GetRegionList.
Definition: ap_cfg.c:747
Application database access functions.
U16BIT ACFG_GetSatelliteScanFreqInc(U32BIT country_code)
Returns the increment frequency to be used when performing a satellite based frequency scan in the gi...
Definition: ap_cfg.c:1318
BOOLEAN ACFG_GetDbLangList(U32BIT country_code, U8BIT ***str_array_ptr, U8BIT *num_langs_ptr)
Returns an array of pointers to strings containing the available language names for the given country...
Definition: ap_cfg.c:844
Header file - macros and function prototypes for public use.
U8BIT ACFG_GetRegionId(void)
Returns the internal ID of the region the DVB is configured for.
Definition: ap_cfg.c:189
void ACFG_SetBackgroundSearchTime(U16BIT start_time, U16BIT end_time)
Sets the start and end times during which background searches are allowed run when in standby...
Definition: ap_cfg.c:1557