/** ALOE headers */ #include #include #include "typetools.h" #include "itf_types.h" #include "inputs.h" #include "outputs.h" #include "stats.h" int configured,counter; int first=0; int get_input_length() { return configured?typeSizeArray(datatype,output_block_length*output_block_rate):0; } int process_input(int len) { int i; Log("Received at %d (len=%d)\n",GetTstamp(),len); counter=0; first=1; return 1; } int process_control(int len) { int i; configured=1; counter=-1; output_block_length = ctrlpkt.output_block_length; output_block_rate = ctrlpkt.output_block_rate; Log("TimeMux: output_length=%d,output_rate=%d\n", output_block_length,output_block_rate); return 1; } int output_ready() { if (counter-1) { return typeSizeArray(datatype,output_block_length); } else { return 0; } } int output_process(int len) { int i; if (counter==-1) return 1; Log("Sending at %d (len=%d) counter %d\n",GetTstamp(),len,counter); memcpy(output_data,&input_data[typeSizeArray(datatype,counter*output_block_length)],sizeof(char)*typeSizeArray(datatype,output_block_length)); counter++; return typeSizeArray(datatype,len); } /** Run function. * @return 1 if ok, 0 if error */ int RunCustom() { return 1; } int InitCustom() { configured=0; if (output_block_rate) configured=1; counter=-1; return 1; } void ConfigInterfaces(){}