Skip to content
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

Added client-side RPC #113

Merged
merged 36 commits into from
Feb 1, 2023
Merged

Added client-side RPC #113

merged 36 commits into from
Feb 1, 2023

Conversation

MathewHDYT
Copy link
Contributor

@MathewHDYT MathewHDYT commented Jan 27, 2023

This pull request includes, additional and updated examples for the ESP32, when using server-side RPC.

Additionally with some help of other people using this library with the ESP8266, some compilation and run-time issues could be fixed. Making the ESP8266 usable again with the newest version of the library. Thanks to #107 and fixing #112.


In addition I integrated an additional method that allows to simply call a method on the ThingsBoard class, and will handle passive OTA updates as well.

Meaning as soon as a Shared attribute update is received in the background the update will be initiated. Additional attributes for the OTA update have been moved into the Callback class.


Furthermore support for client-side RPC has now been added and all methods of the Library code now include a detailed doxygen comment about their respective functionality to make it more user-friendly to use. Adding the wanted feature of #110.

I also adjusted some of the methods to reflect their APIs more exactly meaning the device name when provisioning or the secret key when claiming are now optional, meaning a nullptr or empty string can simply be passed and it will not be sent to the cloud, which results in different behaviour from the ThingsBoard server. All those functionalities have been described in detail in the method doxygen comments.


Additionally the provision API and example have been updated to not require a manual subscription before being able to call Provision Device, both Subscription and Unsubscription is now automatically handled by the ThingsBoard class itself.

The provision API also now allows for any possible provisioning state with different constructor for each possiblity.


Moreover I added support for non ESP-boards with the inclusion of #define guards that check wheter the board actually supports the needed C++ STL functionalities, if not workarounds with the Arduino String, as well as basic c-style function pointers and c-style arrays have been integrated. Thanks to #111.


Additionally the FW_STATES send by the device during an OTA update have been updated to reflect the API as well, meaning the UPDATED, has to be sent at the start of the firmware instead.

This has also been added to the example to reflect this change more clearly.

In addition the OTA update now includes an additonal callback that is called whenever a chunk was successfully updated, with the current amount of downloaded chunks and the total chunks we need to download. Making it possible to track the progress of the update and display it for an end user on a screen or in the console.


Last but not least I updated the version to 0.9.0, I have done this mainly because the changes in the Pull Request include breaking API changes, with new methods adjusted methods calls and renames to make the naming scheme more uniform.

Therefore I think only increasing the patch number might cause confusion.

I also added dependencies into both the config files used by ArduinoIDE and PlattformIO, to set the needed libraries as dependencies, this should in future fix the issues where the user has to download the needed dependencies them self and instead can let their IDE do the job for them.

If the changes could be integrated, that would be highly appreciated @imbeacon.

@imbeacon imbeacon merged commit fdf652a into thingsboard:master Feb 1, 2023
@MathewHDYT
Copy link
Contributor Author

Would be nice if it would be possible to create a new GitHub release for the changes and thanks for the quick merge :D.

@imbeacon
Copy link
Member

imbeacon commented Feb 1, 2023

Hi @MathewHDYT ,

Thanks for your contribution, it is already created.

@MathewHDYT MathewHDYT deleted the feat_examples branch February 2, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants