File tree 4 files changed +25
-0
lines changed
ArduinoIoTCloud-Callbacks
4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 10
10
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
11
11
#endif
12
12
13
+ #if defined(HAS_LORA )
14
+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
15
+ #endif
16
+
13
17
void onSwitchButtonChange ();
14
18
void onColorChange ();
15
19
@@ -30,6 +34,8 @@ void initProperties() {
30
34
ArduinoCloud .addProperty (switchButton , 1 , Permission ::Write ).onUpdate (onSwitchButtonChange );
31
35
ArduinoCloud .addProperty (location , 2 , Permission ::Read ).publishOnChange (0.0f );
32
36
ArduinoCloud .addProperty (color , 3 , Permission ::ReadWrite ).onUpdate (onColorChange );
37
+
38
+ ArduinoCloud .setThingId (THING_ID );
33
39
#endif
34
40
}
35
41
Original file line number Diff line number Diff line change 10
10
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
11
11
#endif
12
12
13
+ #if defined(HAS_LORA )
14
+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
15
+ #endif
16
+
13
17
void onLedChange ();
14
18
15
19
bool led ;
@@ -29,6 +33,8 @@ void initProperties() {
29
33
ArduinoCloud .addProperty (led , 1 , Permission ::ReadWrite ).onUpdate (onLedChange );
30
34
ArduinoCloud .addProperty (potentiometer , 2 , Permission ::Read ).publishOnChange (10 );
31
35
ArduinoCloud .addProperty (seconds , 3 , Permission ::Read ).publishEvery (5 * MINUTES );
36
+
37
+ ArduinoCloud .setThingId (THING_ID );
32
38
#endif
33
39
}
34
40
Original file line number Diff line number Diff line change 10
10
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
11
11
#endif
12
12
13
+ #if defined(BOARD_HAS_LORA )
14
+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
15
+ #endif
16
+
13
17
void initProperties () {
14
18
#if defined(BOARD_HAS_SECRET_KEY )
15
19
ArduinoCloud .setBoardId (BOARD_ID );
16
20
ArduinoCloud .setSecretDeviceKey (SECRET_DEVICE_KEY );
17
21
#endif
22
+ #if defined(BOARD_HAS_LORA )
23
+ ArduinoCloud .setThingId (THING_ID );
24
+ #endif
18
25
}
19
26
20
27
#if defined(BOARD_HAS_WIFI )
Original file line number Diff line number Diff line change 10
10
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
11
11
#endif
12
12
13
+ #if defined(HAS_LORA )
14
+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
15
+ #endif
16
+
13
17
void onSwitchButtonChange ();
14
18
15
19
bool switchButton ;
@@ -37,6 +41,8 @@ void initProperties() {
37
41
ArduinoCloud .addProperty (yearly , Permission ::ReadWrite );
38
42
#elif defined(HAS_LORA )
39
43
ArduinoCloud .addProperty (switchButton , 1 , Permission ::Write );
44
+
45
+ ArduinoCloud .setThingId (THING_ID );
40
46
#endif
41
47
}
42
48
You can’t perform that action at this time.
0 commit comments