CloudConfigRK
|
Update configuration via Particle event. More...
#include <CloudConfigRK.h>
Public Member Functions | |
CloudConfigUpdateSubscription () | |
Default constructor. | |
CloudConfigUpdateSubscription (const char *eventName) | |
Constructor with event name. More... | |
CloudConfigUpdateSubscription & | withEventName (const char *eventName) |
Method to set the event name to subscribe to. More... | |
virtual void | setup () |
Called during setup() More... | |
void | subscriptionHandler (const char *eventName, const char *eventData) |
Handler called when the event is received. | |
Public Member Functions inherited from CloudConfigUpdate | |
CloudConfigUpdate () | |
Default constructor. | |
virtual void | loop () |
Called during loop() to allow update methods to have loop time. More... | |
virtual void | startUpdate () |
Called when subclasses should update the data from the cloud. More... | |
Protected Attributes | |
String | eventName |
Subscribed event name passed to constructor or withEventName. Used during setup(). | |
Additional Inherited Members | |
Data Fields inherited from CloudConfigUpdate | |
unsigned long | waitAfterCloudConnectedMs = 2000 |
How long to wait after cloud connected to update settings. | |
unsigned long | updateTimeoutMs = 60000 |
If a response is not received in this amount of time, an error is assumed and another attempt will be made later. More... | |
Protected Member Functions inherited from CloudConfigUpdate | |
virtual | ~CloudConfigUpdate () |
Destructor. Base class destructor is empty. Also, you can't delete one of these. | |
CloudConfigUpdate (const CloudConfigUpdate &)=delete | |
This class is not copyable. | |
CloudConfigUpdate & | operator= (const CloudConfigUpdate &)=delete |
This class is not copyable. | |
Update configuration via Particle event.
Subscription is a good choice if:
You will probably want to subclass this if you want to be able to have the device request an update since there is no way for this class to know how to request it. See CloudConfigUpdateWebhook for and example of using startUpdate() to make a request.
|
inline |
Constructor with event name.
eventName | The name of the event to subscribe to |
|
virtual |
Called during setup()
Be sure to set the eventName before calling setup()!
Reimplemented from CloudConfigUpdate.
|
inline |
Method to set the event name to subscribe to.
eventName | The name of the event to subscribe to |
This must be called before setup(). Calling it later will have no effect.