Skip to content

Commit 6f51148

Browse files
committed
Clarify onOTARequestCb usage in the example sketch
1 parent 00a2f6b commit 6f51148

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/ArduinoIoTCloud-DeferredOTA/ArduinoIoTCloud-DeferredOTA.ino

+9-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ bool ask_user_via_serial() {
4646
return false;
4747
}
4848

49+
bool onOTARequestCallback()
50+
{
51+
/* Select the preferred behaviour changing the called function */
52+
//return always_deny();
53+
//return always_allow();
54+
return ask_user_via_serial();
55+
}
56+
4957
void setup() {
5058
/* Initialize serial and wait up to 5 seconds for port to open */
5159
Serial.begin(9600);
@@ -61,7 +69,7 @@ void setup() {
6169
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
6270

6371
/* Setup OTA callback */
64-
ArduinoCloud.onOTARequestCb(always_deny);
72+
ArduinoCloud.onOTARequestCb(onOTARequestCallback);
6573

6674
setDebugMessageLevel(DBG_INFO);
6775
ArduinoCloud.printDebugInfo();

0 commit comments

Comments
 (0)