|  | @ -295,12 +295,14 @@ class Communication : public CommQueue<> { | 
			
		
	
		
		
			
				
					|  |  |                         return; |  |  |                         return; | 
			
		
	
		
		
			
				
					|  |  |                     } |  |  |                     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |                     compilePayload(q); |  |  |                     if(compilePayload(q)) { | 
			
				
				
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |                         if((NULL != mCbPayload) && (GridOnProFilePara != q->cmd) && (GetLossRate != q->cmd)) |  |  |                         if((NULL != mCbPayload) && (GridOnProFilePara != q->cmd) && (GetLossRate != q->cmd)) | 
			
		
	
		
		
			
				
					|  |  |                             (mCbPayload)(q->cmd, q->iv); |  |  |                             (mCbPayload)(q->cmd, q->iv); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |                         closeRequest(q, true); |  |  |                         closeRequest(q, true); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                     } else | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         closeRequest(q, false); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |                     break; |  |  |                     break; | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
	
		
		
			
				
					|  | @ -498,7 +500,7 @@ class Communication : public CommQueue<> { | 
			
		
	
		
		
			
				
					|  |  |             return accepted; |  |  |             return accepted; | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |         inline void compilePayload(const queue_s *q) { |  |  |         inline bool compilePayload(const queue_s *q) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             uint16_t crc = 0xffff, crcRcv = 0x0000; |  |  |             uint16_t crc = 0xffff, crcRcv = 0x0000; | 
			
		
	
		
		
			
				
					|  |  |             for(uint8_t i = 0; i < mMaxFrameId; i++) { |  |  |             for(uint8_t i = 0; i < mMaxFrameId; i++) { | 
			
		
	
		
		
			
				
					|  |  |                 if(i == (mMaxFrameId - 1)) { |  |  |                 if(i == (mMaxFrameId - 1)) { | 
			
		
	
	
		
		
			
				
					|  | @ -514,13 +516,12 @@ class Communication : public CommQueue<> { | 
			
		
	
		
		
			
				
					|  |  |                 DBGPRINT(F("CRC Error ")); |  |  |                 DBGPRINT(F("CRC Error ")); | 
			
		
	
		
		
			
				
					|  |  |                 if(q->attempts == 0) { |  |  |                 if(q->attempts == 0) { | 
			
		
	
		
		
			
				
					|  |  |                     DBGPRINTLN(F("-> Fail")); |  |  |                     DBGPRINTLN(F("-> Fail")); | 
			
		
	
		
		
			
				
					|  |  |                     closeRequest(q, false); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |                 } else |  |  |                 } else | 
			
		
	
		
		
			
				
					|  |  |                     DBGPRINTLN(F("-> complete retransmit")); |  |  |                     DBGPRINTLN(F("-> complete retransmit")); | 
			
		
	
		
		
			
				
					|  |  |                 mCompleteRetry = true; |  |  |                 mCompleteRetry = true; | 
			
		
	
		
		
			
				
					|  |  |                 mState = States::RESET; |  |  |                 mState = States::RESET; | 
			
		
	
		
		
			
				
					
					|  |  |                 return; |  |  |                 return false; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |             memset(mPayload, 0, MAX_BUFFER); |  |  |             memset(mPayload, 0, MAX_BUFFER); | 
			
		
	
	
		
		
			
				
					|  | @ -530,7 +531,7 @@ class Communication : public CommQueue<> { | 
			
		
	
		
		
			
				
					|  |  |             for(uint8_t i = 0; i < mMaxFrameId; i++) { |  |  |             for(uint8_t i = 0; i < mMaxFrameId; i++) { | 
			
		
	
		
		
			
				
					|  |  |                 if(mLocalBuf[i].len + len > MAX_BUFFER) { |  |  |                 if(mLocalBuf[i].len + len > MAX_BUFFER) { | 
			
		
	
		
		
			
				
					|  |  |                     DPRINTLN(DBG_ERROR, F("payload buffer to small!")); |  |  |                     DPRINTLN(DBG_ERROR, F("payload buffer to small!")); | 
			
		
	
		
		
			
				
					
					|  |  |                     return; |  |  |                     return true; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                 } |  |  |                 } | 
			
		
	
		
		
			
				
					|  |  |                 memcpy(&mPayload[len], mLocalBuf[i].buf, mLocalBuf[i].len); |  |  |                 memcpy(&mPayload[len], mLocalBuf[i].buf, mLocalBuf[i].len); | 
			
		
	
		
		
			
				
					|  |  |                 len += mLocalBuf[i].len; |  |  |                 len += mLocalBuf[i].len; | 
			
		
	
	
		
		
			
				
					|  | @ -552,19 +553,18 @@ class Communication : public CommQueue<> { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |             if(GridOnProFilePara == q->cmd) { |  |  |             if(GridOnProFilePara == q->cmd) { | 
			
		
	
		
		
			
				
					|  |  |                 q->iv->addGridProfile(mPayload, len); |  |  |                 q->iv->addGridProfile(mPayload, len); | 
			
		
	
		
		
			
				
					
					|  |  |                 return; |  |  |                 return true; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |             record_t<> *rec = q->iv->getRecordStruct(q->cmd); |  |  |             record_t<> *rec = q->iv->getRecordStruct(q->cmd); | 
			
		
	
		
		
			
				
					|  |  |             if(NULL == rec) { |  |  |             if(NULL == rec) { | 
			
		
	
		
		
			
				
					|  |  |                 if(GetLossRate == q->cmd) { |  |  |                 if(GetLossRate == q->cmd) { | 
			
		
	
		
		
			
				
					|  |  |                     q->iv->parseGetLossRate(mPayload, len); |  |  |                     q->iv->parseGetLossRate(mPayload, len); | 
			
		
	
		
		
			
				
					
					|  |  |                     return; |  |  |                     return true; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 } else { |  |  |                 } else | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |                     DPRINTLN(DBG_ERROR, F("record is NULL!")); |  |  |                     DPRINTLN(DBG_ERROR, F("record is NULL!")); | 
			
		
	
		
		
			
				
					
					|  |  |                     closeRequest(q, false); |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 } |  |  |                 return false; | 
			
				
				
			
		
	
		
		
			
				
					|  |  |                 return; |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |             if((rec->pyldLen != len) && (0 != rec->pyldLen)) { |  |  |             if((rec->pyldLen != len) && (0 != rec->pyldLen)) { | 
			
		
	
		
		
			
				
					|  |  |                 if(*mSerialDebug) { |  |  |                 if(*mSerialDebug) { | 
			
		
	
	
		
		
			
				
					|  | @ -572,10 +572,8 @@ class Communication : public CommQueue<> { | 
			
		
	
		
		
			
				
					|  |  |                     DBGPRINT(String(rec->pyldLen)); |  |  |                     DBGPRINT(String(rec->pyldLen)); | 
			
		
	
		
		
			
				
					|  |  |                     DBGPRINTLN(F(" bytes")); |  |  |                     DBGPRINTLN(F(" bytes")); | 
			
		
	
		
		
			
				
					|  |  |                 } |  |  |                 } | 
			
		
	
		
		
			
				
					|  |  |                 /*q->iv->radioStatistics.rxFail++;*/ |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                 closeRequest(q, false); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |                 return; |  |  |                 return false; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |             rec->ts = q->ts; |  |  |             rec->ts = q->ts; | 
			
		
	
	
		
		
			
				
					|  | @ -597,6 +595,7 @@ class Communication : public CommQueue<> { | 
			
		
	
		
		
			
				
					|  |  |                     yield(); |  |  |                     yield(); | 
			
		
	
		
		
			
				
					|  |  |                 } |  |  |                 } | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             return true; | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |         void sendRetransmit(const queue_s *q, uint8_t i) { |  |  |         void sendRetransmit(const queue_s *q, uint8_t i) { | 
			
		
	
	
		
		
			
				
					|  | 
 |