MistyGro API
C++ API for MistyGro's ESP32 controller based on the Arduino framework
Public Member Functions | List of all members
FireLogger Class Reference

Firebase RTDB logger. More...

#include <firebase_logger.h>

Public Member Functions

 FireLogger ()
 
void begin (const char *fire_url, const char *fire_token, const char *email, const char *pass)
 initialise and authorise system to use Firebase RTDB (real time database) make sure wifi is initialised before calling this method More...
 
void set_int (const char *path, int64_t value)
 Set an integer value. More...
 
void set_float (const char *path, double value)
 Set a float value. More...
 
void set_string (const char *path, const char *value)
 Set a string value. More...
 
void set_bool (const char *path, bool value)
 Set a bool value. More...
 
void push_time (const char *path, time_t timestamp)
 Push a timestamp into a list to a relative path, useful to log times like when initialisation was completed. More...
 
bool is_ready ()
 Check if authenticated. More...
 
bool is_keep_alive ()
 Get TCP keepalive status. More...
 
bool is_connected ()
 Get http server connection status. More...
 
bool check_and_refresh_token ()
 refresh token if expired More...
 

Detailed Description

Firebase RTDB logger.

Definition at line 27 of file firebase_logger.h.

Constructor & Destructor Documentation

◆ FireLogger()

FireLogger::FireLogger ( )

Definition at line 34 of file firebase_logger.cpp.

Member Function Documentation

◆ begin()

void FireLogger::begin ( const char *  fire_url,
const char *  fire_token,
const char *  email,
const char *  pass 
)

initialise and authorise system to use Firebase RTDB (real time database) make sure wifi is initialised before calling this method

Parameters
fire_urlFirebase url for the RTDB
fire_tokenToken for auth
emailuser email
passuser password

Definition at line 36 of file firebase_logger.cpp.

◆ check_and_refresh_token()

bool FireLogger::check_and_refresh_token ( )

refresh token if expired

Returns
true if token refreshed

Definition at line 116 of file firebase_logger.cpp.

◆ is_connected()

bool FireLogger::is_connected ( )

Get http server connection status.

Returns
true if connected

Definition at line 32 of file firebase_logger.cpp.

◆ is_keep_alive()

bool FireLogger::is_keep_alive ( )

Get TCP keepalive status.

Returns
true if TCP keepalive is set

Definition at line 30 of file firebase_logger.cpp.

◆ is_ready()

bool FireLogger::is_ready ( )

Check if authenticated.

Returns
true if authenticated

Definition at line 114 of file firebase_logger.cpp.

◆ push_time()

void FireLogger::push_time ( const char *  path,
time_t  timestamp 
)

Push a timestamp into a list to a relative path, useful to log times like when initialisation was completed.

Parameters
pathrelative path for the user
timestamptime_t type timestamp

Definition at line 107 of file firebase_logger.cpp.

◆ set_bool()

void FireLogger::set_bool ( const char *  path,
bool  value 
)

Set a bool value.

Parameters
pathrelative path for the user
valuebool value

Definition at line 100 of file firebase_logger.cpp.

◆ set_float()

void FireLogger::set_float ( const char *  path,
double  value 
)

Set a float value.

Parameters
pathrelative path for the user
valuefloat value

Definition at line 86 of file firebase_logger.cpp.

◆ set_int()

void FireLogger::set_int ( const char *  path,
int64_t  value 
)

Set an integer value.

Parameters
pathrelative path for the user
valueint value

Definition at line 79 of file firebase_logger.cpp.

◆ set_string()

void FireLogger::set_string ( const char *  path,
const char *  value 
)

Set a string value.

Parameters
pathrelative path for the user
valuechar* value

Definition at line 93 of file firebase_logger.cpp.


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