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 
			
		
		
		
	Fix type of Adafruit_MQTT_Subscribe::lastread
The lastread array stores the data bytes of the most recently read received packet. It was previously declared as an array of pointers to uint8_t, instead of an array of uint8_t, which obviously was not the intention. Because the examples explicitely cast to (char*) for printing (because Print::println(uint8_t[]) is not defined) and a pointer is at least as big as uint8_t and memcpy uses void*, this problem did not show up before.
This commit is contained in:
		@@ -202,7 +202,7 @@ class Adafruit_MQTT_Subscribe {
 | 
				
			|||||||
  const char *topic;
 | 
					  const char *topic;
 | 
				
			||||||
  uint8_t qos;
 | 
					  uint8_t qos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  uint8_t * lastread[SUBSCRIPTIONDATALEN];
 | 
					  uint8_t lastread[SUBSCRIPTIONDATALEN];
 | 
				
			||||||
 private:
 | 
					 private:
 | 
				
			||||||
  Adafruit_MQTT *mqtt;
 | 
					  Adafruit_MQTT *mqtt;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user