-
-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing compiler warnings due to stronger compile-time checks (#69)
* Fixing issues uncovered by stronger compiler warnings * Adding const qualifier for parameter 'char * fmt' -> 'const char * fmt' thereby eliminating -Wwrite-strings warnings * Adding missing cases to switch statements * Removing unused variable 'index' * Reording initialisation order of ArduinoIoTCloud in order to eliminate '-Wreorder' warnings * Adding const qualifier for parameter 'char * fmt' -> 'const char * fmt' thereby eliminating -Wwrite-strings warnings * Prefixing 'connection' with an underscore -> '_connection' in order to be consistent with all other member variables * Preventing multiple definitions of SECRET_PASS mutually overwriting one another by prefixing the correct connection type * Changing type of timeout intervals to type unsigned long - otherwise there is a type inconsistency and probable bug when checking the connection time interval * Removing duplicate ERROR case * Adding missing cases and simplifying code * Changing type of timeout intervals to type unsigned long - otherwise there is a type inconsistency and probable bug when checking the connection time interval * Using default clause for missing switch statements (no constant defined for state DISCONNECTING) * Fix -Wreorder error * Simplifying WifiConnectionManager * Replacing '#warning' with '#pragma message' * Fixing comparison between unsigned and signed type * Ignoring error stemming from warning about deprecated functions * Rectifying signed/unsigned comparison * char * arrays should be compared via strcmp * Commenting out unused parameters in order to prevent -Wunused-parameter * Removing unused variable connection buffer * Adding missing switch cases * Correct initlisation of struct tm t * Correct printf specifier for unsigned long it is %lu * Adding missing initializer for tm_isdst * Performing cast in order to guarantuee correct comparison * Fixing formatting * Disabling '-Wunused-variable' to prevent false positives * Removing prefix 'WIFI_' and 'GSM_' because Arduino Create is looking for 'SECRET_SSID', 'SECRET_PASS', etc. when importing a example project into Arduino Create * Correcting comment * Removing prefix of parameter 'newState' wherever used, since prefixes usually indicate class members * Consting parameter 'newState' - defensive programming
- Loading branch information
Showing
15 changed files
with
175 additions
and
121 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
/* | ||
Fill in your login credentials: | ||
#include <ConnectionManager.h> | ||
|
||
The following lines are used for WiFi enabled boards (MKR1000, MKR WiFi 1010) | ||
*/ | ||
#define SECRET_SSID "YOUR_WIFI_NETWORK_NAME" | ||
#define SECRET_PASS "YOUR_WIFI_PASSWORD" | ||
/* | ||
If you prefer using a MKR GSM 1400 comment the lines above and uncommet the following. | ||
PIN, APN, Login and Password are supplied by your Cellular Data provider. | ||
*/ | ||
#define SECRET_PIN "" | ||
#define SECRET_APN "" | ||
#define SECRET_LOGIN "" | ||
#define SECRET_PASS "" | ||
/* MKR1000, MKR WiFi 1010 */ | ||
#if defined(BOARD_HAS_WIFI) | ||
#define SECRET_SSID "YOUR_WIFI_NETWORK_NAME" | ||
#define SECRET_PASS "YOUR_WIFI_PASSWORD" | ||
#endif | ||
|
||
/* MKR GSM 1400 */ | ||
#if defined(BOARD_HAS_GSM) | ||
#define SECRET_PIN "" | ||
#define SECRET_APN "" | ||
#define SECRET_LOGIN "" | ||
#define SECRET_PASS "" | ||
#endif |
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,9 +1,15 @@ | ||
/* (MKR1000, MKR WiFi 1010) */ | ||
#define SECRET_SSID "YOUR_WIFI_NETWORK_NAME" | ||
#define SECRET_PASS "YOUR_WIFI_PASSWORD" | ||
#include <ConnectionManager.h> | ||
|
||
/* MKR GSM 1400 comment the lines above and uncommet the following. */ | ||
#define SECRET_PIN "" | ||
#define SECRET_APN "" | ||
#define SECRET_LOGIN "" | ||
#define SECRET_PASS "" | ||
/* MKR1000, MKR WiFi 1010 */ | ||
#if defined(BOARD_HAS_WIFI) | ||
#define SECRET_SSID "YOUR_WIFI_NETWORK_NAME" | ||
#define SECRET_PASS "YOUR_WIFI_PASSWORD" | ||
#endif | ||
|
||
/* MKR GSM 1400 */ | ||
#if defined(BOARD_HAS_GSM) | ||
#define SECRET_PIN "" | ||
#define SECRET_APN "" | ||
#define SECRET_LOGIN "" | ||
#define SECRET_PASS "" | ||
#endif |
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
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
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
Oops, something went wrong.