/** Sample ALOE component implementation file Specific module code */ /** Include general data type library */ #include "typetools.h" #include "itf_types.h" /** Required include according original code need*/ #include "dec_LDPC.h" /*GLOBAL VARIABLES & BUFFERS*/ int value; extern max_iter; //extern _EbN0; extern N; extern char *pchk_file, *gen_file; char pchk_fileH[100]; char gen_fileH[100]; #define BUFFERSIZE 100*1024 /** Initialization: At INIT PHASE*/ void init_my_prog() { // 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_DeLDPC(); printf("%s: INIT_DeLDPC: data/802_16e.pchk OK\n", GetObjectName()); printf("%s: IF ERROR CHECK DATA FILE REPOSITORY\n", GetObjectName()); } /** RUN PHASE * 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; char info_out_chars[BUFFERSIZE]; /**Properly typecast your input data pointer and check the input data type*/ if(processingtypeIN==TYPE_FLOAT)input_f=(float *)pdatain; else if(processingtypeIN==TYPE_BIT8)input_c=(char *)pdatain; else{ printf("wimax_DECODLDPC.my_prog(): ERROR INPUT DATA TYPE NON VALID\n"); return(-1); } if(processingtypeOUT==TYPE_BIT8)output_c=(char *)pdataout; else { printf("wimax_DECODLDPC.my_prog(): ERROR OUTPUT DATA TYPE NON VALID\n"); return(-1); } max_iter = myctrl.iters; _EbN0 = myctrl.EbN0; //*YOUR CODE*/ /** ONLY FOR TESTING PURPOSES: MODULATE BPSK*/ if(processingtypeIN==TYPE_BIT8) for(i=0; i