7979# ifdef __has_include
8080# if __has_include(<functional>)
8181# include < functional>
82- # define MQTT_CALLBACK_SIGNATURE std::function<void (char *, uint8_t *, unsigned int )> callback
82+ # define MQTT_CALLBACK_SIGNATURE std::function<void (char *, uint8_t *, size_t )> callback
8383# else
84- # define MQTT_CALLBACK_SIGNATURE void (*callback)(char *, uint8_t *, unsigned int )
84+ # define MQTT_CALLBACK_SIGNATURE void (*callback)(char *, uint8_t *, size_t )
8585# endif
8686# else
87- # define MQTT_CALLBACK_SIGNATURE void (*callback)(char *, uint8_t *, unsigned int )
87+ # define MQTT_CALLBACK_SIGNATURE void (*callback)(char *, uint8_t *, size_t )
8888# endif
8989
9090#define CHECK_STRING_LENGTH (l,s ) if (l+2 +strnlen(s, this ->bufferSize) > this ->bufferSize) {_client->stop ();return false ;}
@@ -154,10 +154,10 @@ class PubSubClient : public Print {
154154 void disconnect ();
155155 boolean publish (const char * topic, const char * payload);
156156 boolean publish (const char * topic, const char * payload, boolean retained);
157- boolean publish (const char * topic, const uint8_t * payload, unsigned int plength);
158- boolean publish (const char * topic, const uint8_t * payload, unsigned int plength, boolean retained);
157+ boolean publish (const char * topic, const uint8_t * payload, size_t plength);
158+ boolean publish (const char * topic, const uint8_t * payload, size_t plength, boolean retained);
159159 boolean publish_P (const char * topic, const char * payload, boolean retained);
160- boolean publish_P (const char * topic, const uint8_t * payload, unsigned int plength, boolean retained);
160+ boolean publish_P (const char * topic, const uint8_t * payload, size_t plength, boolean retained);
161161 // Start to publish a message.
162162 // This API:
163163 // beginPublish(...)
@@ -166,7 +166,7 @@ class PubSubClient : public Print {
166166 // Allows for arbitrarily large payloads to be sent without them having to be copied into
167167 // a new buffer and held in memory at one time
168168 // Returns 1 if the message was started successfully, 0 if there was an error
169- boolean beginPublish (const char * topic, unsigned int plength, boolean retained);
169+ boolean beginPublish (const char * topic, size_t plength, boolean retained);
170170 // Finish off this publish message (started with beginPublish)
171171 // Returns 1 if the packet was sent successfully, 0 if there was an error
172172 int endPublish ();
0 commit comments