Skip to content

Commit

Permalink
Allow the large message publishing to use all the print methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian McEwen committed Sep 4, 2018
1 parent 3b3a8da commit 0c2d12d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PubSubClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#define MQTT_CALLBACK_SIGNATURE void (*callback)(char*, uint8_t*, unsigned int)
#endif

class PubSubClient {
class PubSubClient : public Print {
private:
Client* _client;
uint8_t buffer[MQTT_MAX_PACKET_SIZE];
Expand Down Expand Up @@ -153,10 +153,10 @@ class PubSubClient {
// Returns 1 if the packet was sent successfully, 0 if there was an error
int endPublish();
// Write a single byte of payload (only to be used with beginPublish/endPublish)
size_t write(uint8_t);
virtual size_t write(uint8_t);
// Write size bytes from buffer into the payload (only to be used with beginPublish/endPublish)
// Returns the number of bytes written
size_t write(const uint8_t *buffer, size_t size);
virtual size_t write(const uint8_t *buffer, size_t size);
boolean subscribe(const char* topic);
boolean subscribe(const char* topic, uint8_t qos);
boolean unsubscribe(const char* topic);
Expand Down

0 comments on commit 0c2d12d

Please sign in to comment.