LOG_D(HW,"sending %d samples at time: %ld, nbAnt %d\n",nsamps,timestamp,nbAnt);
staticint64_tTO_sim_shift=0;
staticuint64_tTO_TS=0;
if(RFsim_DriftPerFrame!=0){
if(TO_gNB_flag){//a UE is active
if(TO_wait_flag){//for the first write when a UE is connected
TO_wait_flag=0;
TO_TS=timestamp+samples_per_slot*nb_slot_per_fram*300+samples_per_slot*5;//start drifting 300 frames after a UE is active, trying to skip all the "trash" frames (5 trash frames currently)
//"samples_per_slot*5" is from the comparison of loging of gNB and UE, for gNB to start drifting the same as UE
}
while(timestamp>(TO_TS+samples_per_slot/2)){//update the TO shift according to the timestamp
if(TO_wait_flag){//for the first write when a UE is connected
TO_wait_flag=0;
TO_TS=timestamp+samples_per_slot*nb_slot_per_fram*300;//start drifting 300 frames after a UE is active, trying to skip all the "trash" frames (5 trash frames currently)
}
while(timestamp>(TO_TS+samples_per_slot/2)){//update the TO shift according to the timestamp