Skip to content

Commit

Permalink
Fix error in examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Apr 9, 2024
1 parent 186e797 commit 8d3e58b
Show file tree
Hide file tree
Showing 92 changed files with 875 additions and 1,100 deletions.
13 changes: 2 additions & 11 deletions examples/App/AppInitialization/CustomAuth/CustomAuth.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,9 @@
* The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e.
* CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken.
*
* 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:
*
* CustomAuth custom_auth(<TimeStatusCallback>, <api_key>, <client_email>, <project_id>, <private_key>, <user_id>, <scope>, <claims>, <expire>);
* CustomAuth::CustomAuth(<TimeStatusCallback>, <api_key>, <client_email>, <project_id>, <private_key>, <user_id>, <scope>, <claims>, <expire>);
*
* <TimeStatusCallback> - The time status callback that provide the UNIX timestamp value used for JWT token signing.
* <api_key> - The web API key of project.
Expand All @@ -31,7 +22,7 @@
* <user_id> - The user ID.
* <scope> - The OAuth scopes.
* <claims> - The OAuth claims.
* <expire> - The expiry period in seconds (less than or equal to 3600).
* <expire> - The expiry period in seconds (less than 3600), 3300 is the default value.
*
* NOTE:
*
Expand Down
18 changes: 7 additions & 11 deletions examples/App/AppInitialization/NoAuth/NoAuth.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
*
* 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.
* <AsyncClient> - The async client.
* <FirebaseApp> - The authentication and access token handler.
* <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token.
*
* The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e.
* CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken.
*
* SYNTAX:
*
* NoAuth no_auth;
* NoAuth::NoAuth();
*
* The complete usage guidelines, please visit https://github.com/mobizt/FirebaseClient
*/
Expand Down
27 changes: 17 additions & 10 deletions examples/App/AppInitialization/SaveAndLoad/SaveAndLoad.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@
*
* 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.
* <AsyncClient> - The async client.
* <FirebaseApp> - The authentication and access token handler.
* <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token.
*
* The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e.
* CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken.
*
* SYNTAX:
*
* FileConfig::FileConfig(<file_name>, <file_callback>);
*
* <file_name> - The filename included path of file that will be used.
* <file_callback> - The callback function that provides file operation.
*
* The file_callback function parameters included the File reference returned from file operation, filename for file operation and file_operating_mode.
* The file_operating_mode included file_mode_open_read, file_mode_open_write, file_mode_open_append and file_mode_open_remove.
*
* The file name can be a name of source (input) and target (output) file that used in upload and download.
*
* SYNTAX:
*
Expand Down
23 changes: 8 additions & 15 deletions examples/App/AppInitialization/ServiceAuth/ServiceAuth.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,22 @@
*
* 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.
* <AsyncClient> - The async client.
* <FirebaseApp> - The authentication and access token handler.
* <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token.
*
* The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e.
* CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken.
*
* SYNTAX:
*
* ServiceAuth service_auth(<TimeStatusCallback>, <api_key>, <client_email>, <project_id>, <private_key>, <expire>);
* ServiceAuth::ServiceAuth(<TimeStatusCallback>, <api_key>, <client_email>, <project_id>, <private_key>, <expire>);
*
* <TimeStatusCallback> - The time status callback that provide the UNIX timestamp value used for JWT token signing.
* <client_email> - The service account client Email.
* <project_id> - The service account project ID.
* <private_key> - The service account private key.
* <expire> - The expiry period in seconds (less than or equal to 3600).
*
* The default network (built-in WiFi) configuration was used by default when
* it was not assign to the function.
* <expire> - The expiry period in seconds (less than 3600), 3300 is the default value.
*
* NOTE:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@
*
* 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.
* <AsyncClient> - The async client.
* <FirebaseApp> - The authentication and access token handler.
* <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token.
*
* The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e.
* CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken.
*
* SYNTAX:
*
* AccessToken access_token(<auth_token>, <expire_in_seconds>, <refresh_token>, <client_id>, <client_secret>);
* AccessToken::AccessToken(<auth_token>, <expire_in_seconds>, <refresh_token>, <client_id>, <client_secret>);
*
* <auth_token> - Auth token from OAuthe2.0 auth.
* <expire_in_seconds> - Expire period in seconds
* <expire_in_seconds> - Expire period in seconds (less than 3600), 3300 is the default value.
* <refresh_token> - Refresh token.
* <client_id> - Client ID.
* <client_secret> Client secret.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,20 @@
*
* 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.
* <AsyncClient> - The async client.
* <FirebaseApp> - The authentication and access token handler.
* <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token.
*
* The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e.
* CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken.
*
* SYNTAX:
*
* CustomToken custom_token(<api_key>, <custom_token>, <expire_in_seconds>);
* CustomToken::CustomToken(<api_key>, <custom_token>, <expire_in_seconds>);
*
* <api_key> - API key can be obtained from Firebase console > Project Overview > Project settings.
* <custom_token> - Auth custom token (jwt signed token).
* <expire_in_seconds> - Expire period in seconds.
* <expire_in_seconds> - Expire period in seconds (less than 3600), 3300 is the default value.
*
* By assign the refresh token as <custom_token>, the auth token will be re-authenticated when calling initializeApp.
*
Expand Down
20 changes: 8 additions & 12 deletions examples/App/AppInitialization/TokenAuth/IDToken/IDToken.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,20 @@
*
* 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.
* <AsyncClient> - The async client.
* <FirebaseApp> - The authentication and access token handler.
* <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token.
*
* The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e.
* CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken.
*
* SYNTAX:
*
* IDToken id_token(<api_key>, <auth_token>, <expire_in_seconds>, <refresh_token>);
* IDToken::IDToken(<api_key>, <auth_token>, <expire_in_seconds>, <refresh_token>);
*
* <api_key> - API key can be obtained from Firebase console > Project Overview > Project settings.
* <auth_token> - Auth token from user auth.
* <expire_in_seconds> - Expire period in seconds.
* <expire_in_seconds> - Expire period in seconds (less than 3600), 3300 is the default value.
* <refresh_token> - Refresh token.
*
* By leaving auth_token empty and assign the refresh token, the auth token will be re-authenticated when calling initializeApp.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
*
* 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.
* <AsyncClient> - The async client.
* <FirebaseApp> - The authentication and access token handler.
* <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token.
*
* The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e.
* CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken.
*
* SYNTAX:
*
* LegacyToken legacy_token(<database_secret>);
* LegacyToken::LegacyToken(<database_secret>);
*
* <database_secret> - The Realtime Database secret.
*
Expand Down
20 changes: 8 additions & 12 deletions examples/App/AppInitialization/UserAuth/UserAuth.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,21 @@
*
* 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.
* <AsyncClient> - The async client.
* <FirebaseApp> - The authentication and access token handler.
* <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token.
*
* The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e.
* CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken.
*
* SYNTAX:
*
* UserAuth user_auth(<api_key>, <user_email>, <user_password>, <expire>);
* UserAuth::UserAuth(<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).
* <expire> - The expiry period in seconds (less than 3600), 3300 is the default value.
*
* To use other network interfaces, network data from one of the following Network classes
* can be assigned.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* SYNTAXES:
* SYNTAX:
*
* DefaultEthernetNetwork network(<Firebase_SPI_ETH_Module>);
*
* The DefaultEthernetNetwork is the Network class that provides the built-in WiFi network configuarion to work in this library.
*
* The DefaultEthernetNetwork class constructor arguments.
* DefaultEthernetNetwork::DefaultEthernetNetwork(<Firebase_SPI_ETH_Module>);
*
* <Firebase_SPI_ETH_Module> - The Firebase_SPI_ETH_Module class object that keeping the pointer to lwip driver for each
* SPI Ethernet module (e.g. ENC28J60lwIP, W5100lwIP and W5500lwIP).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/**
* SYNTAXES:
* SYNTAX:
*
* DefaultNetwork network(<reconnect>);
* DefaultNetwork::DefaultNetwork(<re_connect_option>);
*
* The DefaultNetwork is the Network class that provides the built-in WiFi network configuarion to work in this library.
*
* The DefaultNetwork class constructor arguments.
*
* <reconnect> - The bool option for network reconnection.
* <re_connect_option> - The Boolean value set for enabling the WiFi reconnection when the WiFi is disconnected.
*
* For WiFi Multi, see examples/NetworkInterfaces/DefaultWiFiNetwork/DefaultWiFiNetwork.ino
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/**
* SYNTAXES:
* SYNTAX:
*
* DefaultWiFiNetwork network(<FirebaseWiFi>, <reconnect>);
* DefaultWiFiNetwork::DefaultWiFiNetwork(<FirebaseWiFi>, <re_connect_option>);
*
* The DefaultWiFiNetwork is the Network class that provides the WiFiMulti network configuarion to work in this library for the WiFiMulti supported devices.
*
* The DefaultWiFiNetwork class constructor arguments.
*
* <FirebaseWiFi> - The FirebaseWiFi class object that used for keeping the network credentials (WiFi APs and WiFi passwords).
*
* <reconnect> - The bool option for network reconnection.
* <FirebaseWiFi> - The FirebaseWiFi class object that used for keeping the network credentials (WiFi AP and WiFi password).
* <re_connect_option> - The Boolean value set for enabling the WiFi reconnection when the WiFi is disconnected.
*
* This type of network class is for WiFi Multi or device that use WiFi class that does not support WiFi reconnection.
*
* For normal WiFi, see examples/NetworkInterfaces/DefaultNetwork/DefaultNetwork.ino
*
Expand Down
14 changes: 4 additions & 10 deletions examples/App/NetworkInterfaces/EthernetNetwork/EthernetNetwork.ino
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
/**
* SYNTAXES:
* SYNTAX:
*
* EthernetNetwork eth_network(<mac>, <cs_pin>, <reset_pin>);
* EthernetNetwork eth_network(<mac>, <cs_pin>, <reset_pin>, <static_ip>);
*
* Firebase_StaticIP staIP(<local_ip>, <subnet>, <gateway>, <dns_server>, <optional>);
*
* The EthernetNetwork is the Network class that provides the Ethernet network configuarion to work in this library.
*
* The EthernetNetwork class constructor arguments.
* EthernetNetwork::EthernetNetwork(<mac>, <cs_pin>, <reset_pin>);
* EthernetNetwork::EthernetNetwork(<mac>, <cs_pin>, <reset_pin>, <static_ip>);
*
* <mac> - The six bytes mac address.
* <cs_pin> - The Ethernet module chip select/enable pin.
* <reset_pin> - The Ethernet module reset pin. Assign -1 if not used.
* <static_ip> - The pointer to Firebase_StaticIP object that holds the static ip configuration.
*
* The Firebase_StaticIP class constructor arguments.
* Firebase_StaticIP staIP(<local_ip>, <subnet>, <gateway>, <dns_server>, <optional>);
*
* <local_ip>, <subnet>, <gateway> and <dns_server> - The static IP, subnet, default gateway and dns server IPs.
* <optional> - The boolean option to force use static ip only (not use DHCP)
Expand Down
8 changes: 2 additions & 6 deletions examples/App/NetworkInterfaces/GSMNetwork/GSMNetwork.ino
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* SYNTAXES:
* SYNTAX:
*
* GSMNetwork gsm_network(<modem>, <gsm_pin>, <apn>, <user>, <password>);
*
* The GSMNetwork is the Network class that provides the GSM network configuarion using TinyGSMClient to work in this library.
*
* The GSMNetwork class constructor arguments.
* GSMNetwork::GSMNetwork(<modem>, <gsm_pin>, <apn>, <user>, <password>);
*
* <modem> - The pointer to TinyGsm modem object. Modem should be initialized and/or set mode before transfering data.
* <gsm_pin> - The SIM pin.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* SYNTAXES:
* SYNTAX:
*
* GenericNetwork generic_network(<net_connect_callback>, <network_status_callback>);
*
* The GenericNetwork is the Network class that provides the generic network configuarion to work in this library.
*
* The GenericNetwork class constructor arguments.
* GenericNetwork::GenericNetwork(<net_connect_callback>, <network_status_callback>);
*
* <net_connect_callback> - The network connection callback function.
* <network_status_callback> - The network status callback function.
Expand Down
Loading

0 comments on commit 8d3e58b

Please sign in to comment.