/** ALOE headers */ #include #include #include "uectrl.h" #include "itf_types.h" #include "inputs.h" #include "outputs.h" #include "stats.h" #include "ctrl_interfaces_types.h" #include "ctrl_interfaces.h" extern int longest_tti; int delay; int tticnt; int changing; int send; int haveChangedStats() { int changed=0; if (reference_mode!=uectrl.reference_mode) { uectrl.reference_mode=reference_mode; changed=1; } return changed; } int haveChangedControl() { if (memcmp(&uectrl,&ctrlpkt,sizeof(struct uectrl_h))) { memcpy(&uectrl,&ctrlpkt,sizeof(struct uectrl_h)); return 1; } return 0; } int process_control(int len) { if (!haveChangedControl()) { return 1; } Log("changed\n"); if (!setParams(&uectrl,send)) { return 0; } delay=1; changing=1; return 1; } int dpcch_send(int len) { return 1; } /******************************* READY SIGNALS */ int source_ready() { return delay==1; } int crc_ready() { return delay==1; } int coder_ready() { return delay==1; } int ratem_ready() { return delay==1; } int interl_ready() { return delay==1; } int rfsegm_ready() { return delay==1; } int trchmux_ready() { return delay==1; } int phch_ready() { return delay==1; } int dpcch_ready() { return delay==1; } /********************************************/ int changing; /** Run function. * @return 1 if ok, 0 if error */ int RunCustom() { int ch; tticnt++; if (tticnt>=longest_tti) tticnt=0; if (send) { if (!changing && tticnt==0) { if (!haveChangedStats()) return 1; changing=1; if (!setParams(&uectrl,send)) { return 0; } } } if (changing) { delay++; if (delay==2) { delay=0; changing=0; } } return 1; } int InitCustom() { delay=0; changing=0; reference_mode=-1; memset(&uectrl,0,sizeof(struct uectrl_h)); memset(&ctrlpkt,0,sizeof(struct uectrl_h)); uectrl.reference_mode=-1; return 1; } void ConfigInterfaces(void) { int i; if (mode) { send=0; memcpy(output_itfs,output_itfs_rx,RX_ITFS*sizeof(struct utils_itf)); } else { send=1; memcpy(output_itfs,output_itfs_tx,TX_ITFS*sizeof(struct utils_itf)); } }