2
2
#include <Arduino_ConnectionHandler.h>
3
3
#include "arduino_secrets.h"
4
4
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 ) || \
6
6
defined(BOARD_HAS_NB ) || defined(BOARD_HAS_ETHERNET ) || defined(BOARD_HAS_CATM1_NBIOT ))
7
7
#error "Please check Arduino IoT Cloud supported boards list: https://github.com/arduino-libraries/ArduinoIoTCloud/#what"
8
8
#endif
11
11
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
12
12
#endif
13
13
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
+
14
22
void onSwitchButtonChange ();
15
23
void onColorChange ();
16
24
@@ -23,7 +31,7 @@ void initProperties() {
23
31
ArduinoCloud .setBoardId (BOARD_ID );
24
32
ArduinoCloud .setSecretDeviceKey (SECRET_DEVICE_KEY );
25
33
#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 )
27
35
ArduinoCloud .addProperty (switchButton , Permission ::Write ).onUpdate (onSwitchButtonChange );
28
36
ArduinoCloud .addProperty (location , Permission ::Read ).publishOnChange (0.0f );
29
37
ArduinoCloud .addProperty (color , Permission ::ReadWrite ).onUpdate (onColorChange );
@@ -34,7 +42,9 @@ void initProperties() {
34
42
#endif
35
43
}
36
44
37
- #if defined(BOARD_HAS_WIFI )
45
+ #if defined(USE_NOTECARD )
46
+ NotecardConnectionHandler ArduinoIoTPreferredConnection (NOTECARD_PRODUCT_UID );
47
+ #elif defined(BOARD_HAS_WIFI )
38
48
WiFiConnectionHandler ArduinoIoTPreferredConnection (SECRET_WIFI_SSID , SECRET_WIFI_PASS );
39
49
#elif defined(BOARD_HAS_GSM )
40
50
GSMConnectionHandler ArduinoIoTPreferredConnection (SECRET_PIN , SECRET_APN , SECRET_LOGIN , SECRET_PASS );
0 commit comments