mirror of
				https://github.com/thelsing/knx.git
				synced 2025-10-26 10:26:25 +01:00 
			
		
		
		
	Rename function for better understanding, fix inverse logic
This commit is contained in:
		
							parent
							
								
									49ae48eacb
								
							
						
					
					
						commit
						b088ffe10d
					
				| @ -27,7 +27,7 @@ bool IpDataLinkLayer::sendFrame(CemiFrame& frame) | ||||
| { | ||||
|     KnxIpRoutingIndication packet(frame); | ||||
|     // only send 50 packet per second: see KNX 3.2.6 p.6
 | ||||
|     if(CheckSendLimit()) | ||||
|     if(isSendLimitReached()) | ||||
|         return false; | ||||
|     bool success = sendBytes(packet.data(), packet.totalLength()); | ||||
|     dataConReceived(frame, success); | ||||
| @ -113,7 +113,7 @@ bool IpDataLinkLayer::sendBytes(uint8_t* bytes, uint16_t length) | ||||
|     return _platform.sendBytesMultiCast(bytes, length); | ||||
| } | ||||
| 
 | ||||
| bool IpDataLinkLayer::CheckSendLimit() | ||||
| bool IpDataLinkLayer::isSendLimitReached() | ||||
| { | ||||
|     uint32_t curTime = millis() / 100; | ||||
| 
 | ||||
| @ -146,7 +146,7 @@ bool IpDataLinkLayer::CheckSendLimit() | ||||
|     if(sum > 50) | ||||
|     { | ||||
|         println("Dropping packet due to 50p/s limit"); | ||||
|         return false;   // drop packet
 | ||||
|         return true;   // drop packet
 | ||||
|     } | ||||
|     else | ||||
|     { | ||||
| @ -155,7 +155,7 @@ bool IpDataLinkLayer::CheckSendLimit() | ||||
|         //print(sum);
 | ||||
|         //print(" curTime: ");
 | ||||
|         //println(curTime);
 | ||||
|         return true; | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| #endif | ||||
|  | ||||
| @ -27,7 +27,7 @@ class IpDataLinkLayer : public DataLinkLayer | ||||
|     uint32_t _frameCountTimeBase = 0; | ||||
|     bool sendFrame(CemiFrame& frame); | ||||
|     bool sendBytes(uint8_t* buffer, uint16_t length); | ||||
|     bool CheckSendLimit(); | ||||
|     bool isSendLimitReached(); | ||||
| 
 | ||||
|     IpParameterObject& _ipParameters; | ||||
| }; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user