/** Example input interfaces configuration file. * * This file configures static input interfaces. In general, data types will be * parametrizable (with an initialization parameter). Therefore, here we will * declare the input_data buffer as a simple byte. In the processing function, * typetools library will convert from a variable type to an internal type. * * If the component only allows certain type, e.g. BITSTREAM in a CRC or FEC you * MUST INDICATE it in this file as a comment. * * * Read sw_api/include/swapi_utils.h and http://flexnets.upc.edu/trac/wiki/ObjectDeveloperGuide * for more documentation on how to use this file * */ /** maximum input buffer for data interface (in bytes)*/ #define INPUT_MAX_DATA 100*1024 /** input buffer is declared as an array of bytes */ typedef char input1_t; input1_t input_data[INPUT_MAX_DATA]; /** declare processing function for the input interface */ int process_input(int len); /** This is the structure for the control interface. It is declared in the * itf_types.h file. Other components sending control parameters to this module * will include the itf_types.h file */ struct sampleControl_h ctrlpkt; int process_control(int len); /** configure input interfaces */ struct utils_itf input_itfs[3] = { {"control", /** Name of the interface (used in the .app) */ sizeof(struct sampleControl_h), /** Size of the sample in bytes */ 1, /** Maximum number of samples (of the buffer) */ &ctrlpkt, /** Buffer to store input data */ NULL, /** A pointer to a function that returns the number of * samples to receive. If set to NULL all pending bytes in the * input FIFO will be readed and stored in the buffer */ process_control}, /** Pointer to function to process data */ {"input", sizeof(input1_t), /** here sample size is 1-byte */ INPUT_MAX_DATA, /** and number of samples is buffer size */ input_data, NULL, /** again, we want to read all pending data */ process_input}, {NULL, 0, 0, 0, 0, 0}}; /** =============== End ================ */