/** Sample ALOE component implementation file Specific module code */ /** Include general data type library */ #include #include #include "typetools.h" #include "itf_types.h" #include "eLDPC_code.h" /*GLOBAL VARIABLES & BUFFERS*/ //int value; #define BSIZE 100*1024 extern char *pchk_file, *gen_file; char pchk_fileH[100]; char gen_fileH[100]; void init_my_prog() { //Path to codification files //pchk_file = "/home/antoni/DADES/WORK/LDPC/repository/data/802_16e.pchk"; //gen_file = "/home/antoni/DADES/WORK/LDPC/repository/data/802_16e.gen"; getcwd(pchk_fileH, 100); getcwd(gen_fileH, 100); sprintf(pchk_fileH, "%s/example-repository/data/802_16e.pchk", pchk_fileH); sprintf(gen_fileH, "%s/example-repository/data/802_16e.gen", gen_fileH); pchk_file = pchk_fileH; gen_file = gen_fileH; printf("%s path: %s\n", GetObjectName(), pchk_file); printf("%s path: %s\n", GetObjectName(), gen_file); Init_eLDPC(); printf("%s: INIT_eLDPC: data/802_16e.pchk OK\n", GetObjectName()); printf("%s: IF ERROR CHECK DATA FILE REPOSITORY\n", GetObjectName()); } /** Module function generic format * Returns the output length or -1 if error */ int my_prog(void *pdatain, void *pdataout,\ int processingtypeIN, int processingtypeOUT,\ int inputlength, ControlMODULENAME_h myctrl) { int i, outputlength; float *input_f, *output_f; char *input_c, *output_c; int *input_i, *output_i; short *input_s, *output_s; int input[BSIZE], output[BSIZE]; /**Properly typecast your input data pointer and check the input data type*/ if(processingtypeIN==TYPE_BIT8)input_c=(char *)pdatain; else { printf("wimax_ENCODLDPC.my_prog(): ERROR INPUT DATA TYPE NON VALID\n"); return(-1); } if(processingtypeOUT==TYPE_BIT8)output_c=(char *)pdataout; else { printf("wimax_ENCODLDPC.my_prog(): ERROR OUTPUT DATA TYPE NON VALID\n"); return(-1); } //*YOUR CODE*/ outputlength=inputlength*myctrl.coderate; for(i=0; i