RDK Documentation (Open Sourced RDK Components)

Description

Functions

void printUsage (char *app_name)
 This function displays the brief usage message for the tool. More...
 
bool processCommandLine (int argc, char **argv, string &mode, string &input_file, string &output_file, string &output_file_sns)
 This API scans parameters from the command line. More...
 
int main (int argc, char **argv)
 
int SiManager::xml_parse_attributes (xmlNodePtr parent)
 This API parses the program id, source id, modulation, frequency information from the XML. More...
 
bool SiManager::load_xml_file (string xml_file)
 This function loads an input xml file into memory, it does the formatting related validations and parses the attributes. More...
 
uint32_t SiManager::calc_mpeg2_crc (uint8_t *data, uint32_t len)
 Function to calculate Cyclic Redundancy Check(CRC) value. CRC is used to find the accidental changes happened to raw data. Here is the CRC flow works here. More...
 
unsigned int SiManager::get_file_size (const char *location)
 The si_get_file_size() function will get the size of the specified file. More...
 
bool SiManager::write_crc_for_si_cache (string sidbFileName)
 This API finds the CRC value and writes at the end of SI cache file. More...
 
bool SiManager::write_crc_for_si_and_sns_cache (string sidbFileName, string snsdbFileName)
 This finds the CRC and write it at the end of SI and SNS cache files. More...
 
void SiManager::init_si_entry (siTableEntry *si_entry)
 Internal Method to initialize service entries to default values init_si_entry() More...
 
bool SiManager::parse_program_details (siTableEntry **si_entry_head, uint32_t frequency[], uint32_t modulation[], int &f_index, int &m_index)
 This API loads the program data from binary cache file. More...
 
bool SiManager::cache_si_data (string sidbFileName)
 This API write the program details like modulation, frequency, program number, VCN information to SI cache file. More...
 
bool SiManager::cache_sns_data (string snsdbFileName)
 This API write the program details like modulation, frequency, program number, VCN information to SI cache file. SNS cache is used to store the data available in NTT(Network Text Tables) by legacy boxes.It contains source id and corresponding source name(channel name) mappings. More...
 
bool SiManager::load_si_data (string sidbFileName)
 This API function loads the program data from binary cache file. More...
 
bool SiManager::Load (string file_name, int mode)
 This API is to load program data from XML file, if the operation mode selected is XML to Binary. Otherwise it will load program data from cache file. More...
 
bool SiManager::GenerateSICache (string sidbFileName)
 Generates binary SI cache from the XML file. More...
 
bool SiManager::GenerateSICache (string sidbFileName, string snsdbFileName)
 Generate both binary SI cache and binary SNS cache from the XML file. More...
 
bool SiManager::GenerateXML (string sixmlFileName)
 Function to generate XML file(sidb.xml). More...
 

Function Documentation

◆ printUsage()

void printUsage ( char *  app_name)

This function displays the brief usage message for the tool.

It includes the usage of the tool, description, options and examples.

Parameters
[in]app_nameIndicates the options for the tools

Definition at line 78 of file si_cache_app.cpp.

◆ processCommandLine()

bool processCommandLine ( int  argc,
char **  argv,
string &  mode,
string &  input_file,
string &  output_file,
string &  output_file_sns 
)

This API scans parameters from the command line.

Parameters
[in]argcNumber of parameters
[in]argvParameter list
[in]modeOperation mode. It can be one of the following: xtob - Generate SI Cache binaries from the given XML file btox - Generate SI Cache XML file from the given binary file dump - Dump channel map from the given binary file to console
[in]input_fileInput file. It can be an XML file or a binary SI Cache file depending on the operation mode
[out]output_fileOutput file. It can be a binary SI Cache file or an XML file depending on the operation mode
[out]output_file_snsBinary SNS Cache file to be generated. To use this option, the mode should be set to 'xtob'.
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 121 of file si_cache_app.cpp.

◆ xml_parse_attributes()

int SiManager::xml_parse_attributes ( xmlNodePtr  parent)
private

This API parses the program id, source id, modulation, frequency information from the XML.

Parameters
[in]parentFirst child node of XML.
Returns
Returns status of the operation.
Return values
0on sucess, appropiate error code otherwise.

Definition at line 81 of file simgr.cpp.

◆ load_xml_file()

bool SiManager::load_xml_file ( string  xml_file)
private

This function loads an input xml file into memory, it does the formatting related validations and parses the attributes.

Parameters
[in]xml_fileXML file name.
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 171 of file simgr.cpp.

◆ calc_mpeg2_crc()

uint32_t SiManager::calc_mpeg2_crc ( uint8_t *  data,
uint32_t  len 
)
private

Function to calculate Cyclic Redundancy Check(CRC) value. CRC is used to find the accidental changes happened to raw data. Here is the CRC flow works here.

  1. Check the SICache file version.
  2. If version doesnt match delete it and get a new version of SICache file and write CRC to the end of SICache file.
  3. If version matches, verify the CRC.
  4. If CRC doesnt match, delete it and get a new version of SICache file and write CRC to the end of SICache file.
  5. if version & CRC matches, load the cache and start using it.
Parameters
[in]dataBinary cache file(SICache file).
[in]lenSize of the file.
Returns
Returns CRC value.

Definition at line 244 of file simgr.cpp.

◆ get_file_size()

unsigned int SiManager::get_file_size ( const char *  location)
private

The si_get_file_size() function will get the size of the specified file.

Parameters
[in]locationXML filename
Returns
The size of the given file.
Return values
-1if the file not present or any other failure.

Definition at line 275 of file simgr.cpp.

◆ write_crc_for_si_cache()

bool SiManager::write_crc_for_si_cache ( string  sidbFileName)
private

This API finds the CRC value and writes at the end of SI cache file.

Parameters
[in]sidbFileNameBinary SI Cache file.
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 295 of file simgr.cpp.

◆ write_crc_for_si_and_sns_cache()

bool SiManager::write_crc_for_si_and_sns_cache ( string  sidbFileName,
string  snsdbFileName 
)
private

This finds the CRC and write it at the end of SI and SNS cache files.

Parameters
[in]sidbFileNameBinary SI Cache file.
[in]snsdbFileNameBinary SNS cache file.
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 367 of file simgr.cpp.

◆ init_si_entry()

void SiManager::init_si_entry ( siTableEntry si_entry)
private

Internal Method to initialize service entries to default values init_si_entry()

Parameters
[in]si_entryService entry to set the default values for.
Returns
None

Definition at line 462 of file simgr.cpp.

◆ parse_program_details()

bool SiManager::parse_program_details ( siTableEntry **  si_entry_head,
uint32_t  frequency[],
uint32_t  modulation[],
int &  f_index,
int &  m_index 
)
private

This API loads the program data from binary cache file.

It checks for the version information and CRC Value and proceeds further in reading modulation, frequency, program number and Virtual channel number.

Parameters
[in]sidbFileNameBinary SI Cache file.
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 504 of file simgr.cpp.

◆ cache_si_data()

bool SiManager::cache_si_data ( string  sidbFileName)
private

This API write the program details like modulation, frequency, program number, VCN information to SI cache file.

Parameters
[in]sidbFileNameBinary SI Cache file.
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 583 of file simgr.cpp.

◆ cache_sns_data()

bool SiManager::cache_sns_data ( string  snsdbFileName)
private

This API write the program details like modulation, frequency, program number, VCN information to SI cache file. SNS cache is used to store the data available in NTT(Network Text Tables) by legacy boxes.It contains source id and corresponding source name(channel name) mappings.

Parameters
[in]snsdbFileNameBinary SNS Cache file.
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 672 of file simgr.cpp.

◆ load_si_data()

bool SiManager::load_si_data ( string  sidbFileName)
private

This API function loads the program data from binary cache file.

It checks for the version information and CRC Value and proceeds further for reading modulation, frequency, program number and Virtual channel number.

Parameters
[in]sidbFileNameBinary SI Cache file.
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 744 of file simgr.cpp.

◆ Load()

bool SiManager::Load ( string  file_name,
int  mode 
)

This API is to load program data from XML file, if the operation mode selected is XML to Binary. Otherwise it will load program data from cache file.

It will also display number of available services.

Parameters
[in]file_nameIt can be an XML file or a binary SI Cache file depending on the operation mode.
[in]modeOperation mode. It can be one of the following: xtob - Generate SI Cache binaries from the given XML file btox - Generate SI Cache XML file from the given binary file
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 885 of file simgr.cpp.

◆ GenerateSICache() [1/2]

bool SiManager::GenerateSICache ( string  sidbFileName)

Generates binary SI cache from the XML file.

Parameters
[out]sidbFileNameBinary SI Cache file
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 939 of file simgr.cpp.

◆ GenerateSICache() [2/2]

bool SiManager::GenerateSICache ( string  sidbFileName,
string  snsdbFileName 
)

Generate both binary SI cache and binary SNS cache from the XML file.

Parameters
[out]sidbFileNameBinary SI Cache file
[out]snsdbFileNameBinary SNS cache file
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 965 of file simgr.cpp.

◆ GenerateXML()

bool SiManager::GenerateXML ( string  sixmlFileName)

Function to generate XML file(sidb.xml).

It uses standard libxml2 methods for XML file creation. XML of the format: <?xml version="1.0" encoding="UTF-8"?> <SIDB> <program sourceid="162" program_number="65535" carrier_frequency="179" modulation_mode="674000000" virtual_channel_number="4"> </SIDB>

Parameters
[out]sixmlFileNameXML file
Returns
Returns status of the operation.
Return values
Trueon sucess, False on failure.

Definition at line 1005 of file simgr.cpp.