22#include <Arduino_ConnectionHandler.h>
33#include "arduino_secrets.h"
44
5- #if !(defined(BOARD_HAS_WIFI ) || defined(BOARD_HAS_GSM ) || defined(BOARD_HAS_LORA ) || \
5+ #if !(defined(USE_NOTECARD ) || defined( BOARD_HAS_WIFI ) || defined(BOARD_HAS_GSM ) || defined(BOARD_HAS_LORA ) || \
66 defined(BOARD_HAS_NB ) || defined(BOARD_HAS_ETHERNET ) || defined(BOARD_HAS_CATM1_NBIOT ))
77 #error "Please check Arduino IoT Cloud supported boards list: https://github.com/arduino-libraries/ArduinoIoTCloud/#what"
88#endif
1111 #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1212#endif
1313
14+ #if defined(USE_NOTECARD )
15+ /* The Notecard can provide connectivity to almost any board via ESLOV (I2C)
16+ * or UART. An empty string (or the default value provided below) will not
17+ * override the Notecard's existing configuration.
18+ * Learn more at: https://dev.blues.io */
19+ #define NOTECARD_PRODUCT_UID "com.domain.you:product"
20+ #endif
21+
1422void onSwitchButtonChange ();
1523void onColorChange ();
1624
@@ -23,7 +31,7 @@ void initProperties() {
2331 ArduinoCloud .setBoardId (BOARD_ID );
2432 ArduinoCloud .setSecretDeviceKey (SECRET_DEVICE_KEY );
2533#endif
26- #if defined(BOARD_HAS_WIFI ) || defined(BOARD_HAS_GSM ) || defined(BOARD_HAS_NB ) || defined(BOARD_HAS_ETHERNET ) || defined(BOARD_HAS_CATM1_NBIOT )
34+ #if defined(USE_NOTECARD ) || defined( BOARD_HAS_WIFI ) || defined(BOARD_HAS_GSM ) || defined(BOARD_HAS_NB ) || defined(BOARD_HAS_ETHERNET ) || defined(BOARD_HAS_CATM1_NBIOT )
2735 ArduinoCloud .addProperty (switchButton , Permission ::Write ).onUpdate (onSwitchButtonChange );
2836 ArduinoCloud .addProperty (location , Permission ::Read ).publishOnChange (0.0f );
2937 ArduinoCloud .addProperty (color , Permission ::ReadWrite ).onUpdate (onColorChange );
@@ -34,7 +42,9 @@ void initProperties() {
3442#endif
3543}
3644
37- #if defined(BOARD_HAS_WIFI )
45+ #if defined(USE_NOTECARD )
46+ NotecardConnectionHandler ArduinoIoTPreferredConnection (NOTECARD_PRODUCT_UID );
47+ #elif defined(BOARD_HAS_WIFI )
3848 WiFiConnectionHandler ArduinoIoTPreferredConnection (SECRET_WIFI_SSID , SECRET_WIFI_PASS );
3949#elif defined(BOARD_HAS_GSM )
4050 GSMConnectionHandler ArduinoIoTPreferredConnection (SECRET_PIN , SECRET_APN , SECRET_LOGIN , SECRET_PASS );
0 commit comments