Skip to content

Final API

Latest
Compare
Choose a tag to compare
@philbowles philbowles released this 21 Dec 19:18
· 16 commits to master since this release

Release Notes v1.0.0
Bug Fixes
getMaxPayloadSize changed to call ESP.getMaxBlockSize to minimise effcets of memory fragmentation

New features
new error / conditions (mostly call when DCX)

New xPublish variants provide some very useful additional functionality (for people who understand how they work) depending on what exactly you want the payload to represent to your app. They allow you to safely handle common data formats without any extra fiddly code of your own that everybody does need when using the bog-standard publish API.

All xPublish variants convert the supplied data type to a buffer address + length (just as you would have to do yourself using the bog-standard publish API) which then allows you to use the matching xPayload call to unpack the correct type in a memory-safe and consistent manner. If you don't understand the above, stick to the simple publish API.

Changes
Breaking
The API has been revamped to provide a logical, consistent and correct API which unfortunately breaks compatibility with the APIs of some other libraries...

Several calls have been changed. Many of the "features" were included solely for early-adopter compatibility with incorrect / illogical "features" of "that other library"

In summary:

all references to msg ID have been removed
redundant properties structures removed (sub-fields are now simply their own callback parameters)
connected() has been removed to prevent incorrectly structured code from breaking. It was never required for correct functionlity anyway
Non-breaking
all "fatal" lockup conditions removed - now causes error code optimised

almost all references to / comparisons with "that other library" have been removed. The major effect on this is that the examples have been heavily mdofied / restructured to run only PangolinMQTT. It should now be just a bad memory.

Deletions
The publish command has had various helpful overloads removed. That functionality has been replaced by various overloads of the xPublish function. The 'x' stands for "expert" so only use these if you fully understand the consequences and make sure you read Payload Handling first. all payloadToxxx funtions (replaced by new xPayload functions) connected redundant error conditions