Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Jan 22, 2025
1 parent 392e7cd commit 23f3de7
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ void setup()

// 10. Start authenticate process.
// ===============================
// It actually add the authentication task in the AsyncClient queue which will be processed later.
// It actually adds the authentication task to the AsyncClient queue which will be processed later.
// The result/status will send to the callback function "asyncCB".
initializeApp(aClient, app, getAuth(sa_auth), asyncCB, "authTask");

// 11. Transfer or bind the authentication credentials
// ====================================================
// The auth credentials from will FirebaseApp will be applied to the Firebase/Google Cloud services classes
// The auth credentials from FirebaseApp will be applied to the Firebase/Google Cloud services classes
// that defined in Step 8.
app.getApp<RealtimeDatabase>(Database);
app.getApp<Messaging>(messaging);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ void setup()

// 10. Start authenticate process.
// ===============================
// It actually add the authentication task in the AsyncClient queue which will be processed later.
// It actually adds the authentication task to the AsyncClient queue which will be processed later.
// The result/status will send to the callback function "asyncCB".
initializeApp(aClient, app, getAuth(user_auth), asyncCB, "authTask");

// 11. Transfer or bind the authentication credentials
// ====================================================
// The auth credentials from will FirebaseApp will be applied to the Firebase/Google Cloud services classes
// The auth credentials from FirebaseApp will be applied to the Firebase/Google Cloud services classes
// that defined in Step 8.
app.getApp<RealtimeDatabase>(Database);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ void setup()

// 11. Start authenticate process.
// ===============================
// It actually add the authentication task in the AsyncClient queue which will be processed later.
// It actually adds the authentication task to the AsyncClient queue which will be processed later.
// The result/status will store in AsyncResult(myResult).
initializeApp(aClient, app, getAuth(sa_auth), myResult);

// 12. Transfer or bind the authentication credentials
// ====================================================
// The auth credentials from will FirebaseApp will be applied to the Firebase/Google Cloud services classes
// The auth credentials from FirebaseApp will be applied to the Firebase/Google Cloud services classes
// that defined in Step 8.
app.getApp<RealtimeDatabase>(Database);
app.getApp<Messaging>(messaging);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ void setup()

// 11. Start authenticate process.
// ===============================
// It actually add the authentication task in the AsyncClient queue which will be processed later.
// It actually adds the authentication task to the AsyncClient queue which will be processed later.
// The result/status will store in AsyncResult(myResult).
initializeApp(aClient, app, getAuth(user_auth), myResult);

// 12. Transfer or bind the authentication credentials
// ====================================================
// The auth credentials from will FirebaseApp will be applied to the Firebase/Google Cloud services classes
// The auth credentials from FirebaseApp will be applied to the Firebase/Google Cloud services classes
// that defined in Step 8.
app.getApp<RealtimeDatabase>(Database);

Expand Down
6 changes: 3 additions & 3 deletions examples/BareMinimum/Sync/AllServices/AllServices.ino
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ void setup()
// Skip certificate verification
ssl_client.setInsecure();

// 11. Start authenticate process.
// 11. Start the authenticate process.
// ===============================
// It actually add the authentication task in the AsyncClient queue which will be processed later.
// It actually adds the authentication task to the AsyncClient queue which will be processed later.
// The result/status will store in AsyncResult(authResult).
initializeApp(aClient, app, getAuth(sa_auth), authResult);

Expand All @@ -106,7 +106,7 @@ void setup()

// 13. Transfer or bind the authentication credentials
// ====================================================
// The auth credentials from will FirebaseApp will be applied to the Firebase/Google Cloud services classes
// The auth credentials from FirebaseApp will be applied to the Firebase/Google Cloud services classes
// that defined in Step 8.
app.getApp<RealtimeDatabase>(Database);
app.getApp<Messaging>(messaging);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ void setup()
// Skip certificate verification
ssl_client.setInsecure();

// 11. Start authenticate process.
// 11. Start the authenticate process.
// ===============================
// It actually add the authentication task in the AsyncClient queue which will be processed later.
// It actually adds the authentication task to the AsyncClient queue which will be processed later.
// The result/status will store in AsyncResult(authResult).
initializeApp(aClient, app, getAuth(user_auth), authResult);

Expand All @@ -96,7 +96,7 @@ void setup()

// 13. Transfer or bind the authentication credentials
// ====================================================
// The auth credentials from will FirebaseApp will be applied to the Firebase/Google Cloud services classes
// The auth credentials from FirebaseApp will be applied to the Firebase/Google Cloud services classes
// that defined in Step 8.
app.getApp<RealtimeDatabase>(Database);

Expand Down
6 changes: 2 additions & 4 deletions src/core/AsyncResult/AppDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ namespace firebase

std::vector<dbg_item> dbgVec;
uint32_t ms = 0, last_ms = 0;
String current_msg, new_msg;
bool available = false;
bool isDebugChecked = false;
String last;
String current_msg, new_msg, last;
bool available = false, isDebugChecked = false;
dbg_item dbg;

void update()
Expand Down
3 changes: 1 addition & 2 deletions src/core/AsyncResult/AppError.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ struct app_error_t

std::vector<err_item> errVec;
uint32_t ms = 0, last_ms = 0;
int current_code = 0, new_code = 0;
int current_code = 0, new_code = 0, last = 0;
bool available = false, isErrorChecked = false;
int last = 0;
err_item err;

void update()
Expand Down
3 changes: 1 addition & 2 deletions src/core/AsyncResult/AppEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ namespace firebase

std::vector<ev_item> evntVec;
uint32_t ms = 0, last_ms = 0;
int current_code = 0, new_code = 0;
int current_code = 0, new_code = 0, last = 0;
bool available = false, isEventChecked = false;
int last = 0;
ev_item ev;

void update()
Expand Down
3 changes: 1 addition & 2 deletions src/core/AsyncResult/AsyncResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ class AsyncResult : public ResultBase, RealtimeDatabaseResult

private:
StringUtil sut;
uint32_t addr = 0;
uint32_t rvec_addr = 0;
uint32_t addr = 0, rvec_addr = 0;
String val[ares_ns::max_type];
download_data_t download_data;
upload_data_t upload_data;
Expand Down
2 changes: 0 additions & 2 deletions src/core/AsyncResult/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@ class ValueConverter
{
sut.clear(buf);
if (std::is_same<T, bool>::value)
{
buf = value ? "true" : "false";
}
else
{
if (v_string<T>::value)
Expand Down
20 changes: 3 additions & 17 deletions src/core/AuthConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,7 @@ namespace firebase
legacy_token_data legacy_token;
#endif

bool anonymous = false;
bool initialized = false;
bool jwt_signing = false;
bool jwt_loop = false;
bool jwt_time_debug = false;
bool anonymous = false, initialized = false, jwt_signing = false, jwt_loop = false, jwt_time_debug = false;
uint32_t jwt_ts = 0;
auth_token_type auth_type = auth_unknown_token;
user_auth_data_type auth_data_type = user_auth_data_undefined;
Expand Down Expand Up @@ -612,12 +608,10 @@ namespace firebase
tokenSize++;
}

String tokens[tokenSize];
String tokens[tokenSize], tmp;
char *p = reinterpret_cast<char *>(mem.alloc(buff.length()));
strcpy(p, buff.c_str());
char *pp = p;
char *end = p;
String tmp;
char *pp = p, *end = p;
int i = 0;
while (pp != NULL)
{
Expand Down Expand Up @@ -830,9 +824,7 @@ namespace firebase
#if defined(ENABLE_FS)
data.clear();
if (userFile.initialized)
{
data.file_data.copy(userFile);
}
#endif
}

Expand Down Expand Up @@ -1074,9 +1066,7 @@ namespace firebase
#if defined(ENABLE_FS)
data.clear();
if (tokenFile.initialized)
{
data.file_data.copy(tokenFile);
}
#endif
}

Expand Down Expand Up @@ -1148,9 +1138,7 @@ namespace firebase
#if defined(ENABLE_FS)
data.clear();
if (tokenFile.initialized)
{
data.file_data.copy(tokenFile);
}
#endif
}

Expand Down Expand Up @@ -1288,9 +1276,7 @@ namespace firebase
#if defined(ENABLE_FS)
data.clear();
if (tokenFile.initialized)
{
data.file_data.copy(tokenFile);
}
#endif
}

Expand Down
5 changes: 0 additions & 5 deletions src/firestore/Databases.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ namespace Firestore

Databases() {}

Databases &operator=(Databases &rhs)
{
return *this;
}

/** Export the documents in the database to the Firebase Storage data bucket.
*
* @param aClient The async client.
Expand Down
5 changes: 1 addition & 4 deletions src/firestore/FirestoreBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ class FirestoreBase : public AppBase
}
};

void url(const String &url)
{
this->service_url = url;
}
void url(const String &url) { this->service_url = url; }

void setApp(uint32_t app_addr, app_token_t *app_token, uint32_t avec_addr, uint32_t ul_dl_task_running_addr)
{
Expand Down
4 changes: 1 addition & 3 deletions src/functions/DataOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,7 @@ namespace GoogleCloudFunctions
{
public:
AsyncClientClass *aClient = nullptr;
String path;
String uid;
String mime;
String path, uid, mime;
reqns::http_request_method method = reqns::http_undefined;
slot_options_t opt;
DataOptions *options = nullptr;
Expand Down
10 changes: 2 additions & 8 deletions src/functions/Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ class CloudFunctions
std::vector<uint32_t> cVec; // AsyncClient vector

~CloudFunctions() {}
explicit CloudFunctions(const String &url = "")
{
this->service_url = url;
};
explicit CloudFunctions(const String &url = "") { this->service_url = url; }

CloudFunctions &operator=(const CloudFunctions &rhs)
{
Expand Down Expand Up @@ -785,10 +782,7 @@ class CloudFunctions
uint32_t app_addr = 0, avec_addr = 0, ul_dl_task_running_addr = 0;
app_token_t *app_token = nullptr;

void url(const String &url)
{
this->service_url = url;
}
void url(const String &url) { this->service_url = url; }

void setApp(uint32_t app_addr, app_token_t *app_token, uint32_t avec_addr, uint32_t ul_dl_task_running_addr)
{
Expand Down
5 changes: 1 addition & 4 deletions src/messaging/DataOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,7 @@ namespace Messages

public:
Parent() {}
explicit Parent(const String &projectId)
{
this->projectId = projectId;
}
explicit Parent(const String &projectId) { this->projectId = projectId; }
String getProjectId() const { return projectId; }
};

Expand Down
5 changes: 1 addition & 4 deletions src/messaging/Messaging.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ class Messaging
std::vector<uint32_t> cVec; // AsyncClient vector

~Messaging() {}
explicit Messaging(const String &url = "")
{
this->service_url = url;
};
explicit Messaging(const String &url = "") { this->service_url = url; }

Messaging &operator=(const Messaging &rhs)
{
Expand Down
10 changes: 2 additions & 8 deletions src/storage/Storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class Storage
std::vector<uint32_t> cVec; // AsyncClient vector

~Storage() {}
explicit Storage(const String &url = "")
{
this->service_url = url;
};
explicit Storage(const String &url = "") { this->service_url = url; }

Storage &operator=(const Storage &rhs)
{
Expand Down Expand Up @@ -382,10 +379,7 @@ class Storage
uint32_t app_addr = 0, avec_addr = 0, ul_dl_task_running_addr = 0, ota_storage_addr = 0;
app_token_t *app_token = nullptr;

void url(const String &url)
{
this->service_url = url;
}
void url(const String &url) { this->service_url = url; }

void setApp(uint32_t app_addr, app_token_t *app_token, uint32_t avec_addr, uint32_t ul_dl_task_running_addr)
{
Expand Down

0 comments on commit 23f3de7

Please sign in to comment.