Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

demo.cpp File Reference


Detailed Description

Journaline(R) news service decoder demonstration program.

Author:
Michael Reichenbaecher <rbr@iis.fraunhofer.de>
Id:
demo.cpp,v 1.1 2004/03/03 11:04:30 rbr Exp

Module: Journaline(R)

Copyright: (C) 2004 Fraunhofer Institut Integrierte Schaltungen, Erlangen

Compiler: gcc version 3.3 20030226 (prerelease) Microsoft Visual C++ .NET

This demonstration program creates a DAB data group decoder and a Journaline(R) news service decoder and feeds the files specified on the command line to the data group decoder.

The user can interactively add further data group files and display arbitrary NML news objects by specifying their object id

Note:
In a real application, there should be a service manager handling (possibly) multiple instances of the two decoder types. In this demonstration, we only use one global instance of each.
#include <stdio.h>
#include <string>
#include <iostream>
#include "NML.h"
#include "newssvcdec.h"
#include "dabdatagroupdecoder.h"

Functions

int ReadDatagroupFile (const char *filename)
 read data group from file

void dg_cb (const DAB_DATAGROUP_DECODER_msc_datagroup_header_t *, const unsigned long len, const unsigned char *buf, void *)
 callback function for data group decoder

void obj_avail_cb (unsigned long number_of_elements, NEWS_SVC_DEC_obj_availability_t *chg_list, void *)
 callback function for Journaline(R) news decoder

int SelectObject (NML::NewsObjectId_t oid)
 select current object

void cmd_help (void)
 command help

std::string cmd_read (void)
 read a user command

int main (int argc, char *argv[])
 news service decoder demonstration main program


Variables

DAB_DATAGROUP_DECODER_t dgdec = NULL
 a unique instance of a DAB data group decoder

NEWS_SVC_DEC_decoder_t newsdec = NULL
 a unique instance of a Journaline(R) news service decoder

int showDdNewsSvcDecErr = 0
int showDdNewsSvcDecInfo = 0
int showDdDabDgDecErr = 0
int showDdDabDgDecInfo = 0

Function Documentation

void cmd_help void   
 

command help

in-program command help

std::string cmd_read void   
 

read a user command

reads one line of user input (max. 80 characters)

Returns :
command line

void dg_cb const DAB_DATAGROUP_DECODER_msc_datagroup_header_t  ,
const unsigned long    len,
const unsigned char *    buf,
void *   
 

callback function for data group decoder

Will be called when a valid DAB datagroup has been evaluated by the DAB data group decoder. Feeds the data field to the Journaline(R) news service decoder

int main int    argc,
char *    argv[]
 

news service decoder demonstration main program

Parameters:
argc  number of arguments + 1
argv  arguments
Returns :
exit status

void obj_avail_cb unsigned long    number_of_elements,
NEWS_SVC_DEC_obj_availability_t   chg_list,
void *   
 

callback function for Journaline(R) news decoder

will be called when the availability of watched news objects changes

int ReadDatagroupFile const char *    filename
 

read data group from file

reads a DAB data group from file and feeds it to the DAB data group decoder

Parameters:
filename  name of file
Return values:
0  failure
1  success

int SelectObject NML::NewsObjectId_t    oid
 

select current object

Parameters:
oid  news object id
Return values:
0  failure


Variable Documentation

DAB_DATAGROUP_DECODER_t dgdec = NULL [static]
 

a unique instance of a DAB data group decoder

NEWS_SVC_DEC_decoder_t newsdec = NULL [static]
 

a unique instance of a Journaline(R) news service decoder

int showDdDabDgDecErr = 0
 

int showDdDabDgDecInfo = 0
 

int showDdNewsSvcDecErr = 0
 

int showDdNewsSvcDecInfo = 0
 


Generated on Thu Mar 18 13:10:33 2004 for journaline_demo by doxygen1.2.17