@ -141,6 +141,8 @@ class Communication : public CommQueue<> { 
			
		
	
		
		
			
				
					                                    q - > iv - > radio - > switchFrequency ( q - > iv ,  HOY_BOOT_FREQ_KHZ ,  ( q - > iv - > config - > frequency * FREQ_STEP_KHZ  +  HOY_BASE_FREQ_KHZ ) ) ;                                     q - > iv - > radio - > switchFrequency ( q - > iv ,  HOY_BOOT_FREQ_KHZ ,  ( q - > iv - > config - > frequency * FREQ_STEP_KHZ  +  HOY_BASE_FREQ_KHZ ) ) ;  
			
		
	
		
		
			
				
					                                    mWaitTime . startTimeMonitor ( 1000 ) ;                                     mWaitTime . startTimeMonitor ( 1000 ) ;  
			
		
	
		
		
			
				
					                                }                                 }  
			
		
	
		
		
			
				
					                                if ( IV_MI  = =  q - > iv - > ivGen )  
			
		
	
		
		
			
				
					                                    q - > iv - > mIvTxCnt + + ;  
			
		
	
		
		
			
				
					                            }                             }  
			
		
	
		
		
			
				
					                            closeRequest ( q ,  false ) ;                             closeRequest ( q ,  false ) ;  
			
		
	
		
		
			
				
					                            break ;                             break ;  
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -733,17 +735,16 @@ class Communication : public CommQueue<> { 
			
		
	
		
		
			
				
					                    miNextRequest ( ( p - > packet [ 0 ]  -  ALL_FRAMES  +  1 ) ,  q ) ;                     miNextRequest ( ( p - > packet [ 0 ]  -  ALL_FRAMES  +  1 ) ,  q ) ;  
			
		
	
		
		
			
				
					                }  else  {                 }  else  {  
			
		
	
		
		
			
				
					                    q - > iv - > miMultiParts  =  7 ;  // indicate we are ready
                     q - > iv - > miMultiParts  =  7 ;  // indicate we are ready
  
			
		
	
		
		
			
				
					                    //miComplete(q->iv);
  
			
		
	
		
		
			
				
					                }                 }  
			
		
	
		
		
			
				
					            }  else  if ( ( p - > packet [ 0 ]  = =  ( MI_REQ_CH1  +  ALL_FRAMES ) )  & &  ( q - > iv - > type  = =  INV_TYPE_2CH ) )  {             }  else  if ( ( p - > packet [ 0 ]  = =  ( MI_REQ_CH1  +  ALL_FRAMES ) )  & &  ( q - > iv - > type  = =  INV_TYPE_2CH ) )  {  
			
		
	
		
		
			
				
					                //addImportant(q->iv, MI_REQ_CH2);
                 //addImportant(q->iv, MI_REQ_CH2);
  
			
		
	
		
		
			
				
					                miNextRequest ( MI_REQ_CH2 ,  q ) ;                 miNextRequest ( MI_REQ_CH2 ,  q ) ;  
			
		
	
		
		
			
				
					                mHeu . evalTxChQuality ( q - > iv ,  true ,  ( q - > attemptsMax  -  1  -  q - > attempts ) ,  q - > iv - > curFrmCnt ) ;                 mHeu . evalTxChQuality ( q - > iv ,  true ,  ( q - > attemptsMax  -  1  -  q - > attempts ) ,  q - > iv - > curFrmCnt ) ;  
			
		
	
		
		
			
				
					
					                //use also miMultiParts here for better statistics? 
                q - > iv - > mIvRxCnt + + ;            // statistics workaround... 
 
			
				
				
			
		
	
		
		
			
				
					
					                //mHeu.setGotFragment(q->iv); 
 
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					            }  else  {                       // first data msg for 1ch, 2nd for 2ch
             }  else  {                       // first data msg for 1ch, 2nd for 2ch
  
			
		
	
		
		
			
				
					                q - > iv - > miMultiParts  + =  6 ;  // indicate we are ready
                 q - > iv - > miMultiParts  + =  6 ;  // indicate we are ready
  
			
		
	
		
		
			
				
					
					                //miComplete(q->iv); 
 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					            }             }  
			
		
	
		
		
			
				
					        }         }  
			
		
	
		
		
			
				
					
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -757,13 +758,9 @@ class Communication : public CommQueue<> { 
			
		
	
		
		
			
				
					                DBGHEXLN ( cmd ) ;                 DBGHEXLN ( cmd ) ;  
			
		
	
		
		
			
				
					            }             }  
			
		
	
		
		
			
				
					
 
			
		
	
		
		
			
				
					
					            if ( q - > iv - > miMultiParts  = =  7 )  {             if ( q - > iv - > miMultiParts  = =  7 )  
			
				
				
			
		
	
		
		
			
				
					                //mHeu.setGotAll(q->iv);
  
			
		
	
		
		
	
		
		
			
				
					                q - > iv - > radioStatistics . rxSuccess + + ;                 q - > iv - > radioStatistics . rxSuccess + + ;  
			
		
	
		
		
			
				
					
					            }  else 
 
			
				
				
			
		
	
		
		
			
				
					                //mHeu.setGotFragment(q->iv);
  
			
		
	
		
		
			
				
					                /*iv->radioStatistics.rxFail++; // got no complete payload*/  
			
		
	
		
		
			
				
					            //q->iv->radioStatistics.retransmits++;
  
			
		
	
		
		
	
		
		
			
				
					            q - > iv - > radio - > sendCmdPacket ( q - > iv ,  cmd ,  0x00 ,  true ) ;             q - > iv - > radio - > sendCmdPacket ( q - > iv ,  cmd ,  0x00 ,  true ) ;  
			
		
	
		
		
			
				
					
 
			
		
	
		
		
			
				
					            mWaitTime . startTimeMonitor ( MI_TIMEOUT ) ;             mWaitTime . startTimeMonitor ( MI_TIMEOUT ) ;  
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -871,6 +868,26 @@ class Communication : public CommQueue<> { 
			
		
	
		
		
			
				
					                DPRINT_IVID ( DBG_INFO ,  iv - > id ) ;                 DPRINT_IVID ( DBG_INFO ,  iv - > id ) ;  
			
		
	
		
		
			
				
					                DBGPRINTLN ( F ( " got all data msgs " ) ) ;                 DBGPRINTLN ( F ( " got all data msgs " ) ) ;  
			
		
	
		
		
			
				
					            }             }  
			
		
	
		
		
			
				
					
 
			
		
	
		
		
			
				
					            if  ( iv - > mGetLossInterval  > =  AHOY_GET_LOSS_INTERVAL )  {  // initially mIvRxCnt = mIvTxCnt = 0
  
			
		
	
		
		
			
				
					                iv - > mGetLossInterval  =  1 ;  
			
		
	
		
		
			
				
					                iv - > radioStatistics . ivSent   =  iv - > mIvRxCnt  +  iv - > mDtuTxCnt ;  // iv->mIvRxCnt is the nr. of additional answer frames, default we expect one frame per request
  
			
		
	
		
		
			
				
					                iv - > radioStatistics . ivLoss   =  iv - > radioStatistics . ivSent  -  iv - > mDtuRxCnt ;  // this is what we didn't receive
  
			
		
	
		
		
			
				
					                iv - > radioStatistics . dtuLoss  =  iv - > mIvTxCnt ;  // this is somehow the requests w/o answers in that periode
  
			
		
	
		
		
			
				
					                iv - > radioStatistics . dtuSent  =  iv - > mDtuTxCnt ;  
			
		
	
		
		
			
				
					                if  ( mSerialDebug )  {  
			
		
	
		
		
			
				
					                    DPRINT_IVID ( DBG_INFO ,  iv - > id ) ;  
			
		
	
		
		
			
				
					                    DBGPRINTLN ( " DTU loss:  "  +  
			
		
	
		
		
			
				
					                        String  ( iv - > radioStatistics . ivLoss )  +  " / "  +  
			
		
	
		
		
			
				
					                        String  ( iv - > radioStatistics . ivSent )  +  "  frames for  "  +  
			
		
	
		
		
			
				
					                        String  ( iv - > radioStatistics . dtuSent )  +  "  requests " ) ;  
			
		
	
		
		
			
				
					                }  
			
		
	
		
		
			
				
					                iv - > mIvRxCnt   =  0 ;   // start new interval, iVRxCnt is abused to collect additional possible frames
  
			
		
	
		
		
			
				
					                iv - > mIvTxCnt   =  0 ;   // start new interval, iVTxCnt is abused to collect nr. of unanswered requests
  
			
		
	
		
		
			
				
					                iv - > mDtuRxCnt  =  0 ;   // start new interval
  
			
		
	
		
		
			
				
					                iv - > mDtuTxCnt  =  0 ;   // start new interval
  
			
		
	
		
		
			
				
					            }  
			
		
	
		
		
			
				
					
 
			
		
	
		
		
			
				
					            record_t < >  * rec  =  iv - > getRecordStruct ( RealTimeRunData_Debug ) ;             record_t < >  * rec  =  iv - > getRecordStruct ( RealTimeRunData_Debug ) ;  
			
		
	
		
		
			
				
					            iv - > setValue ( iv - > getPosByChFld ( 0 ,  FLD_YD ,  rec ) ,  rec ,  calcYieldDayCh0 ( iv , 0 ) ) ;             iv - > setValue ( iv - > getPosByChFld ( 0 ,  FLD_YD ,  rec ) ,  rec ,  calcYieldDayCh0 ( iv , 0 ) ) ;