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 
			
		
		
		
	essentially, add Zero support by shimming in the missing functions
This commit is contained in:
		@@ -21,6 +21,14 @@
 | 
				
			|||||||
// SOFTWARE.
 | 
					// SOFTWARE.
 | 
				
			||||||
#include "Adafruit_MQTT.h"
 | 
					#include "Adafruit_MQTT.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef dtostrf
 | 
				
			||||||
 | 
					static char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
 | 
				
			||||||
 | 
					  char fmt[20];
 | 
				
			||||||
 | 
					  sprintf(fmt, "%%%d.%df", width, prec);
 | 
				
			||||||
 | 
					  sprintf(sout, fmt, val);
 | 
				
			||||||
 | 
					  return sout;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void printBuffer(uint8_t *buffer, uint8_t len) {
 | 
					void printBuffer(uint8_t *buffer, uint8_t len) {
 | 
				
			||||||
  for (uint8_t i=0; i<len; i++) {
 | 
					  for (uint8_t i=0; i<len; i++) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,10 +22,11 @@
 | 
				
			|||||||
#ifndef _ADAFRUIT_MQTT_H_
 | 
					#ifndef _ADAFRUIT_MQTT_H_
 | 
				
			||||||
#define _ADAFRUIT_MQTT_H_
 | 
					#define _ADAFRUIT_MQTT_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if ARDUINO >= 100
 | 
					#include "Arduino.h"
 | 
				
			||||||
 #include "Arduino.h"
 | 
					
 | 
				
			||||||
#else
 | 
					#ifdef ARDUINO_SAMD_ZERO
 | 
				
			||||||
 #include "WProgram.h"
 | 
					#define strncpy_P(dest, src, len) strncpy((dest), (src), (len))
 | 
				
			||||||
 | 
					#define strncasecmp_P(f1, f2, len) strncasecmp((f1), (f2), (len))
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Uncomment/comment to turn on/off debug output messages.
 | 
					// Uncomment/comment to turn on/off debug output messages.
 | 
				
			||||||
@@ -33,6 +34,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Set where debug messages will be printed.
 | 
					// Set where debug messages will be printed.
 | 
				
			||||||
#define DEBUG_PRINTER Serial
 | 
					#define DEBUG_PRINTER Serial
 | 
				
			||||||
 | 
					// If using something like Zero or Due, change the above to SerialUSB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Define actual debug output functions when necessary.
 | 
					// Define actual debug output functions when necessary.
 | 
				
			||||||
#ifdef MQTT_DEBUG
 | 
					#ifdef MQTT_DEBUG
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user