Skip to content

Commit

Permalink
examples: add CellularConnectionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Aug 14, 2024
1 parent 12e9def commit e57ab50
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 5 deletions.
4 changes: 3 additions & 1 deletion examples/ArduinoIoTCloud-Advanced/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#endif

/* MKR GSM 1400 */ /* MKR NB 1500 */ /* Portenta CAT.M1/NB IoT GNSS Shield */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || defined(BOARD_HAS_CATM1_NBIOT)
/* Portenta H7 and C33 + Portenta Mid Carrier + 4G Module */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || \
defined(BOARD_HAS_CATM1_NBIOT) || defined(BOARD_HAS_CELLULAR)
#define SECRET_PIN ""
#define SECRET_APN ""
#define SECRET_LOGIN ""
Expand Down
2 changes: 2 additions & 0 deletions examples/ArduinoIoTCloud-Advanced/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ void initProperties() {
//EthernetConnectionHandler ArduinoIoTPreferredConnection;
/* Manual mode. It will fallback in DHCP mode if SECRET_OPTIONAL_IP is invalid or equal to "0.0.0.0" */
EthernetConnectionHandler ArduinoIoTPreferredConnection(SECRET_OPTIONAL_IP, SECRET_OPTIONAL_DNS, SECRET_OPTIONAL_GATEWAY, SECRET_OPTIONAL_NETMASK);
#elif defined(BOARD_HAS_CELLULAR)
CellularConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#endif
4 changes: 3 additions & 1 deletion examples/ArduinoIoTCloud-Basic/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#endif

/* MKR GSM 1400 */ /* MKR NB 1500 */ /* Portenta CAT.M1/NB IoT GNSS Shield */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || defined(BOARD_HAS_CATM1_NBIOT)
/* Portenta H7 and C33 + Portenta Mid Carrier + 4G Module */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || \
defined(BOARD_HAS_CATM1_NBIOT) || defined(BOARD_HAS_CELLULAR)
#define SECRET_PIN ""
#define SECRET_APN ""
#define SECRET_LOGIN ""
Expand Down
2 changes: 2 additions & 0 deletions examples/ArduinoIoTCloud-Basic/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ void initProperties() {
NBConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#elif defined(BOARD_HAS_CATM1_NBIOT)
CatM1ConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#elif defined(BOARD_HAS_CELLULAR)
CellularConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#endif
4 changes: 3 additions & 1 deletion examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#endif

/* MKR GSM 1400 */ /* MKR NB 1500 */ /* Portenta CAT.M1/NB IoT GNSS Shield */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || defined(BOARD_HAS_CATM1_NBIOT)
/* Portenta H7 and C33 + Portenta Mid Carrier + 4G Module */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || \
defined(BOARD_HAS_CATM1_NBIOT) || defined(BOARD_HAS_CELLULAR)
#define SECRET_PIN ""
#define SECRET_APN ""
#define SECRET_LOGIN ""
Expand Down
2 changes: 2 additions & 0 deletions examples/ArduinoIoTCloud-Callbacks/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ void initProperties() {
//EthernetConnectionHandler ArduinoIoTPreferredConnection;
/* Manual mode. It will fallback in DHCP mode if SECRET_OPTIONAL_IP is invalid or equal to "0.0.0.0" */
EthernetConnectionHandler ArduinoIoTPreferredConnection(SECRET_OPTIONAL_IP, SECRET_OPTIONAL_DNS, SECRET_OPTIONAL_GATEWAY, SECRET_OPTIONAL_NETMASK);
#elif defined(BOARD_HAS_CELLULAR)
CellularConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#endif
4 changes: 3 additions & 1 deletion examples/ArduinoIoTCloud-Schedule/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#endif

/* MKR GSM 1400 */ /* MKR NB 1500 */ /* Portenta CAT.M1/NB IoT GNSS Shield */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || defined(BOARD_HAS_CATM1_NBIOT)
/* Portenta H7 and C33 + Portenta Mid Carrier + 4G Module */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || \
defined(BOARD_HAS_CATM1_NBIOT) || defined(BOARD_HAS_CELLULAR)
#define SECRET_PIN ""
#define SECRET_APN ""
#define SECRET_LOGIN ""
Expand Down
2 changes: 2 additions & 0 deletions examples/ArduinoIoTCloud-Schedule/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@ void initProperties() {
//EthernetConnectionHandler ArduinoIoTPreferredConnection;
/* Manual mode. It will fallback in DHCP mode if SECRET_OPTIONAL_IP is invalid or equal to "0.0.0.0" */
EthernetConnectionHandler ArduinoIoTPreferredConnection(SECRET_OPTIONAL_IP, SECRET_OPTIONAL_DNS, SECRET_OPTIONAL_GATEWAY, SECRET_OPTIONAL_NETMASK);
#elif defined(BOARD_HAS_CELLULAR)
CellularConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#endif
4 changes: 3 additions & 1 deletion examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#endif

/* MKR GSM 1400 */ /* MKR NB 1500 */ /* Portenta CAT.M1/NB IoT GNSS Shield */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || defined(BOARD_HAS_CATM1_NBIOT)
/* Portenta H7 and C33 + Portenta Mid Carrier + 4G Module */
#if defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || \
defined(BOARD_HAS_CATM1_NBIOT) || defined(BOARD_HAS_CELLULAR)
#define SECRET_PIN ""
#define SECRET_APN ""
#define SECRET_LOGIN ""
Expand Down
2 changes: 2 additions & 0 deletions examples/utility/ArduinoIoTCloud_Travis_CI/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ String str_property_8;
//EthernetConnectionHandler ArduinoIoTPreferredConnection;
/* Manual mode. It will fallback in DHCP mode if SECRET_OPTIONAL_IP is invalid or equal to "0.0.0.0" */
EthernetConnectionHandler ArduinoIoTPreferredConnection(SECRET_OPTIONAL_IP, SECRET_OPTIONAL_DNS, SECRET_OPTIONAL_GATEWAY, SECRET_OPTIONAL_NETMASK);
#elif defined(BOARD_HAS_CELLULAR)
CellularConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#endif

/******************************************************************************
Expand Down

0 comments on commit e57ab50

Please sign in to comment.