CloudConfigRK
Public Member Functions | Data Fields | Protected Member Functions
CloudConfigUpdate Class Reference

Abstract base class for updating cloud config data. More...

#include <CloudConfigRK.h>

Inheritance diagram for CloudConfigUpdate:
CloudConfigUpdateFunction CloudConfigUpdateSubscription CloudConfigUpdateWebhook

Public Member Functions

 CloudConfigUpdate ()
 Default constructor.
 
virtual void setup ()
 Called during setup() to allow update methods to have setup time. More...
 
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...
 

Data Fields

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

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.
 
CloudConfigUpdateoperator= (const CloudConfigUpdate &)=delete
 This class is not copyable.
 

Detailed Description

Abstract base class for updating cloud config data.

Member Function Documentation

◆ loop()

virtual void CloudConfigUpdate::loop ( )
inlinevirtual

Called during loop() to allow update methods to have loop time.

Optional for subclasses to override.

◆ setup()

virtual void CloudConfigUpdate::setup ( )
inlinevirtual

Called during setup() to allow update methods to have setup time.

Optional for subclasses to override.

Reimplemented in CloudConfigUpdateSubscription, and CloudConfigUpdateFunction.

◆ startUpdate()

virtual void CloudConfigUpdate::startUpdate ( )
inlinevirtual

Called when subclasses should update the data from the cloud.

Optional for subclasses to override, but typically useful to do so. It is called after cloud connected and after waitAfterCloudConnectedMs depending on the settings for updateFrequency.

The subclass must call ConfigConfig::instance().updateData() or ConfigConfig::instance().updateDataFailed() if this method is called.

Reimplemented in CloudConfigUpdateWebhook.

Field Documentation

◆ updateTimeoutMs

unsigned long CloudConfigUpdate::updateTimeoutMs = 60000

If a response is not received in this amount of time, an error is assumed and another attempt will be made later.

If subclasses take a long time to retrieve data you may need to override this value from your subclass constructor or setup method.


The documentation for this class was generated from the following file: