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

Additional update policy "OnDemand" #135

Merged
merged 2 commits into from
Jun 8, 2020
Merged

Additional update policy "OnDemand" #135

merged 2 commits into from
Jun 8, 2020

Conversation

aentinger
Copy link
Collaborator

@aentinger aentinger commented Jun 8, 2020

This new update policy allows to trigger the transmission of all properties when a certain function (push) is called. In order to configure a property for this update policy it must be initalized using the following syntax in thing_properties.h:

int seconds;
/* ... */
void initProperties()
{
  ArduinoCloud.addProperty(seconds, Permission::Read).publishOnDemand();

In order to trigger the update the ArduinoCloud.push() needs to be called. All properties are transmitted on the next call of ArduinoCloud.update().

void loop()
{
  /* ... */
  ArduinoCloud.update();
  /* ... */
  ArduinoCloud.push();
}

Successfully tested on PROD with

  • MKR WiFi 1010 ✔️
  • MKR 1000 ✔️
  • ESP8266 ✔️

aentinger added 2 commits June 8, 2020 12:28
…ll properties is set leading to encoding and a transmission to the cloud on the next call to update
@aentinger
Copy link
Collaborator Author

Here's your update on demand policy @manchoz and @zmoog 👋

@github-actions
Copy link

github-actions bot commented Jun 8, 2020

Memory usage change @5b00945615dc5ff6fb830988c1fc1da2f8f81af4

FQBN Flash Usage RAM For Global Variables
arduino:samd:mkr1000 🔺 +16 0
arduino:samd:mkrgsm1400 🔺 +16 0
arduino:samd:mkrnb1500 🔺 +16 0
arduino:samd:mkrwan1300 🔺 +16 0
arduino:samd:mkrwifi1010 🔺 +16 0
arduino:samd:nano_33_iot 🔺 +24 0
esp8266:esp8266:huzzah 🔺 +32 0

@aentinger aentinger merged commit 419fd32 into master Jun 8, 2020
@aentinger aentinger deleted the update-on-demand branch June 8, 2020 11:01
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.

1 participant