You've already forked Adafruit_MQTT_Library
							
							
				mirror of
				https://github.com/adafruit/Adafruit_MQTT_Library.git
				synced 2025-11-03 11:53:11 +03:00 
			
		
		
		
	Merge pull request #95 from fpistm/min_STL
Fix min() usage when using STL C++
This commit is contained in:
		@@ -81,7 +81,7 @@ bool Adafruit_MQTT_Client::sendPacket(uint8_t *buffer, uint16_t len) {
 | 
				
			|||||||
    if (client->connected()) {
 | 
					    if (client->connected()) {
 | 
				
			||||||
      // send 250 bytes at most at a time, can adjust this later based on Client
 | 
					      // send 250 bytes at most at a time, can adjust this later based on Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      uint16_t sendlen = min(len, 250);
 | 
					      uint16_t sendlen = min(len, (uint16_t)250);
 | 
				
			||||||
      //Serial.print("Sending: "); Serial.println(sendlen);
 | 
					      //Serial.print("Sending: "); Serial.println(sendlen);
 | 
				
			||||||
      ret = client->write(buffer, sendlen);
 | 
					      ret = client->write(buffer, sendlen);
 | 
				
			||||||
      DEBUG_PRINT(F("Client sendPacket returned: ")); DEBUG_PRINTLN(ret);
 | 
					      DEBUG_PRINT(F("Client sendPacket returned: ")); DEBUG_PRINTLN(ret);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user