File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed
ArduinoIoTCloud-Callbacks Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 11
11
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
12
12
#endif
13
13
14
+ #if defined(BOARD_HAS_LORA )
15
+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
16
+ #endif
17
+
14
18
void onSwitchButtonChange ();
15
19
void onColorChange ();
16
20
@@ -23,6 +27,9 @@ void initProperties() {
23
27
ArduinoCloud .setBoardId (BOARD_ID );
24
28
ArduinoCloud .setSecretDeviceKey (SECRET_DEVICE_KEY );
25
29
#endif
30
+ #if defined(BOARD_HAS_LORA )
31
+ ArduinoCloud .setThingId (THING_ID );
32
+ #endif
26
33
#if defined(BOARD_HAS_WIFI ) || defined(BOARD_HAS_GSM ) || defined(BOARD_HAS_NB ) || defined(BOARD_HAS_ETHERNET ) || defined(BOARD_HAS_CATM1_NBIOT )
27
34
ArduinoCloud .addProperty (switchButton , Permission ::Write ).onUpdate (onSwitchButtonChange );
28
35
ArduinoCloud .addProperty (location , Permission ::Read ).publishOnChange (0.0f );
Original file line number Diff line number Diff line change 11
11
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
12
12
#endif
13
13
14
+ #if defined(BOARD_HAS_LORA )
15
+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
16
+ #endif
17
+
14
18
void onLedChange ();
15
19
16
20
bool led ;
@@ -22,6 +26,9 @@ void initProperties() {
22
26
ArduinoCloud .setBoardId (BOARD_ID );
23
27
ArduinoCloud .setSecretDeviceKey (SECRET_DEVICE_KEY );
24
28
#endif
29
+ #if defined(BOARD_HAS_LORA )
30
+ ArduinoCloud .setThingId (THING_ID );
31
+ #endif
25
32
#if defined(BOARD_HAS_WIFI ) || defined(BOARD_HAS_GSM ) || defined(BOARD_HAS_NB ) || defined(BOARD_HAS_ETHERNET ) || defined(BOARD_HAS_CATM1_NBIOT )
26
33
ArduinoCloud .addProperty (led , Permission ::Write ).onUpdate (onLedChange );
27
34
ArduinoCloud .addProperty (potentiometer , Permission ::Read ).publishOnChange (10 );
Original file line number Diff line number Diff line change 11
11
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
12
12
#endif
13
13
14
+ #if defined(BOARD_HAS_LORA )
15
+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
16
+ #endif
17
+
14
18
void initProperties () {
15
19
#if defined(BOARD_HAS_SECRET_KEY )
16
20
ArduinoCloud .setBoardId (BOARD_ID );
17
21
ArduinoCloud .setSecretDeviceKey (SECRET_DEVICE_KEY );
18
22
#endif
23
+ #if defined(BOARD_HAS_LORA )
24
+ ArduinoCloud .setThingId (THING_ID );
25
+ #endif
19
26
}
20
27
21
28
#if defined(BOARD_HAS_WIFI )
Original file line number Diff line number Diff line change 11
11
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
12
12
#endif
13
13
14
+ #if defined(BOARD_HAS_LORA )
15
+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
16
+ #endif
17
+
14
18
void onSwitchButtonChange ();
15
19
16
20
bool switchButton ;
@@ -27,6 +31,9 @@ void initProperties() {
27
31
ArduinoCloud .setBoardId (BOARD_ID );
28
32
ArduinoCloud .setSecretDeviceKey (SECRET_DEVICE_KEY );
29
33
#endif
34
+ #if defined(BOARD_HAS_LORA )
35
+ ArduinoCloud .setThingId (THING_ID );
36
+ #endif
30
37
#if defined(BOARD_HAS_WIFI ) || defined(BOARD_HAS_GSM ) || defined(BOARD_HAS_NB ) || defined(BOARD_HAS_ETHERNET ) || defined(BOARD_HAS_CATM1_NBIOT )
31
38
ArduinoCloud .addProperty (switchButton , Permission ::Write );
32
39
ArduinoCloud .addProperty (oneShot , Permission ::ReadWrite );
You can’t perform that action at this time.
0 commit comments