-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
149 additions
and
9,938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,4 @@ | ||
// Created by K. Suwatchai (Mobizt) | ||
// Email: [email protected] | ||
// Github: https://github.com/mobizt/FirebaseClient | ||
// Copyright (c) 2024 mobizt | ||
|
||
/** | ||
* PRE REQUISITE | ||
* ============= | ||
* | ||
* IAM owner permission required for service account, | ||
* https://github.com/mobizt/Firebase-ESP-Client#iam-permission-and-api-enable | ||
*/ | ||
|
||
/** | ||
* APP INITIALIZATION | ||
* ================== | ||
* | ||
* This library provides the APIs covers the different types of authentication and services. | ||
* | ||
* The FirebaseApp class was introduced as user authentication provider which provides the credentials data | ||
* used for accessing the Firebase services. | ||
* | ||
* The Database, Firestore, Functions, Messaging, Storage and Cloud Storage apps provided the functions based on | ||
* the specific Firebase services which take the auth credentials data from FirebaseApp. | ||
* | ||
* The FirebaseApp should be initialized first before use via static function initializeApp. | ||
* | ||
* SYNTAXES: | ||
* | ||
* initializeApp(<AsyncClient>, <FirebaseApp>, <user_auth_data>); | ||
* | ||
* The AsyncClient stores the user, server and network data which can be initialized as. | ||
* | ||
* WiFiClientSecure ssl_client; | ||
* DefaultNetwork network; | ||
* AsyncClient aClient(ssl_client, getNetwork(network)); | ||
* | ||
* The FirebaseApp manage and stores the authentication data; | ||
* | ||
* The user_auth_data store the user credentials which can be obtained from one of following Auth classes. | ||
* UserAuth, ServiceAuth, CustomAuth, IDToken, AccessToken, CustomToken, LegacyToken and NoAuth via static function getAuth. | ||
* | ||
* SYNTAX: | ||
* | ||
* UserAuth user_auth(<api_key>, <user_email>, <user_password>, <expire>); | ||
* | ||
* <api_key> - API key can be obtained from Firebase console > Project Overview > Project settings. | ||
* <user_email> - The user Email that in the project. | ||
* <user_password> - The user password in the project. | ||
* <expire> - The expiry period in seconds (less than or equal to 3600). | ||
* | ||
* To use other network interfaces, network data from one of the following Network classes | ||
* can be assigned. | ||
* | ||
* DefaultNetwork, GenericNetwork, EthernetNetwork and GSMNetwork. | ||
* | ||
* The network data (network_config_data) can be obtained from these Network classes via static function getNetwork. | ||
* | ||
* Please see examples/App/NetworkInterfaces for the usage guidelines. | ||
* | ||
* The auth credential data can be set to Services App e.g. Database to initialize via function getApp. | ||
* | ||
* SYNTAX: | ||
* | ||
* app.getApp<T>(<services_app>); | ||
* | ||
* Deallocation of FirebaseApp causes these services apps uninitialized and cannot be used. | ||
* | ||
*/ | ||
|
||
/** | ||
* DELETE OBJECT FUNCTIONS | ||
* ======================= | ||
* | ||
* SYNTAXES: | ||
* | ||
* cstorage.deleteObject(<AsyncClient>, <FirebaseStorage::Parent>, <GoogleCloudStorage::DeleteOptions>); | ||
|
@@ -93,91 +20,7 @@ | |
* | ||
* The uid can later get from AsyncResult object of AsyncResultCallback function via aResult.uid(). | ||
* | ||
*/ | ||
|
||
/** | ||
* ASYNC QUEUE | ||
* =========== | ||
* | ||
* Each sync and async requests data consume memory up to 1k. When many async operations are added to queue (FIFO), the memory usage was increased. | ||
* | ||
* Each AsyncClient handles this queue separately. Then in order to limit the memory used for each AsyncClient, | ||
* this library allows 10 async operations (called slots) can be stored in the queue at a time. | ||
* | ||
* The maximum queue size can be set via the build flag FIREBASE_ASYNC_QUEUE_LIMIT or macro in | ||
* src/Config.h or created your own config in src/UserConfig.h. | ||
* | ||
* If the authentication async operation was required, it will insert to the first slot of the queue. | ||
* | ||
* If the sync operation was called, it will insert to the first slot in the queue too but after the authentication task slot. | ||
* | ||
* When async Get operation in SSE mode (HTTP Streaming) was currently stored in queue, the new sync and async operations will be inserted before | ||
* the async SSE (HTTP Streaming) slot. | ||
* | ||
* When the async operation queue is full, the new sync and async operations will be cancelled. | ||
* | ||
* The finished and time out operating slot will be removed from the queue unless the async SSE and allow the vacant slot for the new async operation. | ||
* | ||
* The async SSE operation will run continuously and repeatedly as long as the FirebaseApp and the services app | ||
* (Database, Firestore, Messaging, Functions, Storage and CloudStorage) objects was run in the loop via app.loop() or database.loop(). | ||
* | ||
* STOP QUEUE | ||
* =========== | ||
* | ||
* SYNTAX: | ||
* | ||
* The async operation will be cancelled and remove from the queue by calling thes functions. | ||
* | ||
* asyncClient.stopAsync() - stop the last async operation in the queue. | ||
* | ||
* asyncClient.stopAsync(true) - stop all async operation in the queue. | ||
* | ||
* asyncClient.stopAsync("xxxx") - stop the async operation in the queue that has the async result UID xxxx. | ||
* | ||
* ASYNC CLIENT | ||
* ============ | ||
* | ||
* The async client stores the async operating data in its queue and holds the pointer of SSL Client that assigned with it. | ||
* | ||
* The SSL Client should be existed in the AsyncClient usage scope in case of sync or should defined as global object for async usage. | ||
* | ||
* The SSL Client should not be shared among various AsyncClients because of interferences in async operations. | ||
* | ||
* Only one SSL Client should be assigned to or used with only one AsyncClient. | ||
* | ||
* SSL Client can force to stop by user or calling stop() from asyncClient. | ||
* | ||
* SYNTAX: | ||
* | ||
* asyncClient.stop() - stop the SSL Client to terminate the server connection. | ||
* | ||
* | ||
* THE STATIC ASYNC RESULT REQUIRED FOR ASYNC OPERATION | ||
* ==================================================== | ||
* | ||
* Library provided the class object called AsyncResult that keeps the server response data, debug and error information. | ||
* | ||
* There are two sources of async result in this library: | ||
* | ||
* 1. From user provided with async application (function). | ||
* | ||
* For example: | ||
* | ||
* `Database.get(aClient, "/test/int", options, aResult);` | ||
* | ||
* 2. From dynamic allocation in the async client. | ||
* | ||
* For example: | ||
* | ||
* `Database.get(aClient, "/test/int", options, asyncCB);` | ||
* | ||
* From source 1, the async result (`aResult`) shall be defined globally to use in async application because of the static data is needed for use while running the sync task. | ||
* | ||
* From source 2, the async client (`aClient`) shall be defined globally to use in async application too to make sure the instance of async result was existed or valid while running the sync task. | ||
* | ||
* If async result was destroyed (destructed or not existed) before it was used by async task handler, the danglig pointer problem will be occurred. | ||
* | ||
* Note that, the async client object used in authentication task shoul be defined globally as it is async task. | ||
* The complete usage guidelines, please visit https://github.com/mobizt/FirebaseClient | ||
*/ | ||
|
||
#include <Arduino.h> | ||
|
Oops, something went wrong.