-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add publish(topic,payload,retained) function. #917
Open
vrdust
wants to merge
207
commits into
knolleary:master
Choose a base branch
from
Imroy:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ectly as an Arduino library
…ack type, rename some arguments
Use WiFiClient instead of Client. Use IPAddress instead of a byte array.
…parameters Why pass in "client"? Just make it a class variable.
willRetain is a boolean and willQos can only be 0, 1, or 2.
…hods by using default values and setters
Move code into the src directory. Add a library.properties file. Specs: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification
…ubSubClient This feels a little like I've reimplmented PubSubClient. I wanted to support more options for the various messages and that meant creating a separate class just for message data. Then to handle the different options for the different messages, I had to create a class for each message type. Streaming functionality is currently not implemented. It is commented out for now.
At one point I had private variables for things that are stored in '_flags'.
As a side effect, it increments the value. Hopefully that's obvious from the name.
Storing Strings in an array appears to be a bad idea.
Assume that next_packet_id() did that already. Improve logic of next_packet_id() to avoid id 0.
… the "end" The reserve() method doesn't change the "length" of the string. So all is left is the += operator (or concat() method).
Prints the topic and payload of every message it receives.
…instead of the MQTT_KEEPALIVE define MQTT_KEEPALIVE is the default value.
…rning false, instead of having a big 'if' block around almost everything
…llow compilation outside of the Arduino env
…brary has no such define And sizes are 32-bit now. TODO: Will have to construct the 'publish' packets with the correct size when this max size is greater than 127 bytes.
MQTT packets can be up to 24MB in size.
MQTT/4 instead of MQIsdp/3
…e packet in Client's buffer Not tested!
A better way to encapsulate the state variables. Still untested!
…g length byte(s) This allows us to parse the small, simple packets e.g connack, ping, etc. They're only four bytes, smaller than the five byte minimum in _read_header(). _read_length() is reenterable, able to shift a single available byte and continue later.
…e message It returns nullptr instead of false.
…s for a response The second one returns a message pointer of the message that came back, thanks to _wait_for().
CONNACK doesn't necessarily mean the connection was successful.
Home Assistant did not like having a null byte after the JSON.
…ffecting device sleep state is used
added setTimeGetter function to support time handling when millis() a…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://github.com/Imroy/pubsubclient