Automatic Curtain  MVP
Software repository for an automatic curtain using stepper motor, TMC2209 and ESP32
Storage Class Reference

#include <storage.h>

Public Member Functions

 Storage (std::shared_ptr< Logging >)
 Construct a new Storage object, initializes logger and calls Storage() More...
 
 ~Storage ()
 Destroy the Storage object, closes Flash. More...
 
bool SaveDeviceCred (const CONFIG_SET::DEVICE_CRED *device_cred)
 Saves the wifi creds and device id to Flash, fetching the data from the variable whose pointer is provided as an argument. More...
 
bool PopulateDeviceCred (CONFIG_SET::DEVICE_CRED *device_cred)
 Retrieves the wifi creds and device id from the flash and populates them in variable whose pointer is provided as an argument. More...
 
bool SaveCalibParam (const CONFIG_SET::CALIB_PARAMS *calib_param)
 Saves the calib params to Flash, fetching the data from the variable whose pointer is provided as an argument. More...
 
bool PopulateCalibParam (CONFIG_SET::CALIB_PARAMS *calib_param)
 Retrieves the calib params from the flash and populates them in variable whose pointer is provided as an argument. More...
 
bool SaveOperationMode (const CONFIG_SET::OPERATION_MODE *mode)
 Saves the operation mode to Flash, fetching the data from the variable whose pointer is provided as an argument. More...
 
bool PopulateOperationMode (CONFIG_SET::OPERATION_MODE *mode)
 Retrieves the operation mode from the flash and populates them in variable whose pointer is provided as an argument. More...
 
void Clear ()
 Clears the memory for CONFIG_SET::STORAGE_NAMESPACE workspace. More...
 

Private Attributes

Preferences preferences_
 
std::shared_ptr< Logginglogger_
 

Constructor & Destructor Documentation

◆ Storage()

Storage::Storage ( std::shared_ptr< Logging logging)

Construct a new Storage object, initializes logger and calls Storage()

◆ ~Storage()

Storage::~Storage ( )

Destroy the Storage object, closes Flash.

Member Function Documentation

◆ Clear()

void Storage::Clear ( )

Clears the memory for CONFIG_SET::STORAGE_NAMESPACE workspace.

◆ PopulateCalibParam()

bool Storage::PopulateCalibParam ( CONFIG_SET::CALIB_PARAMS calib_param)

Retrieves the calib params from the flash and populates them in variable whose pointer is provided as an argument.

Returns
true : populate successful
false : otherwise

◆ PopulateDeviceCred()

bool Storage::PopulateDeviceCred ( CONFIG_SET::DEVICE_CRED device_cred)

Retrieves the wifi creds and device id from the flash and populates them in variable whose pointer is provided as an argument.

Returns
true : populate successful
false : otherwise

◆ PopulateOperationMode()

bool Storage::PopulateOperationMode ( CONFIG_SET::OPERATION_MODE mode)

Retrieves the operation mode from the flash and populates them in variable whose pointer is provided as an argument.

Returns
true : populate successful
false : otherwise

◆ SaveCalibParam()

bool Storage::SaveCalibParam ( const CONFIG_SET::CALIB_PARAMS calib_param)

Saves the calib params to Flash, fetching the data from the variable whose pointer is provided as an argument.

Returns
true : if save successful
false : otherwise

◆ SaveDeviceCred()

bool Storage::SaveDeviceCred ( const CONFIG_SET::DEVICE_CRED device_cred)

Saves the wifi creds and device id to Flash, fetching the data from the variable whose pointer is provided as an argument.

Returns
true : if save successful
false : otherwise

◆ SaveOperationMode()

bool Storage::SaveOperationMode ( const CONFIG_SET::OPERATION_MODE mode)

Saves the operation mode to Flash, fetching the data from the variable whose pointer is provided as an argument.

Returns
true : if save successful
false : otherwise

Member Data Documentation

◆ logger_

std::shared_ptr<Logging> Storage::logger_
private

◆ preferences_

Preferences Storage::preferences_
private

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