Skip to content

Commit 79532b1

Browse files
committed
fix: Address PR Feedback
1 parent cdc1938 commit 79532b1

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ paragraph=Originally part of ArduinoIoTCloud
77
category=Communication
88
url=https://github.com/arduino-libraries/Arduino_ConnectionHandler
99
architectures=samd,esp32,esp8266,mbed,megaavr,mbed_nano,mbed_portenta,mbed_nicla,mbed_opta,mbed_giga,renesas_portenta,renesas_uno,mbed_edge,stm32
10-
depends=Arduino_DebugUtils, Blues Wireless Notecard (>=1.6.0), WiFi101, WiFiNINA, MKRGSM, MKRNB, MKRWAN
10+
depends=Arduino_DebugUtils, WiFi101, WiFiNINA, MKRGSM, MKRNB, MKRWAN, Blues Wireless Notecard (>=1.6.0)

src/Arduino_NotecardConnectionHandler.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const String & NotecardConnectionHandler::syncArduinoDeviceId (const String & de
202202
}
203203
}
204204

205-
if (_keep_alive && initiateNotehubSync()) {
205+
if (initiateNotehubSync()) {
206206
Debug.print(DBG_ERROR, F("Failed to sync Arduino Device ID."));
207207
}
208208
}
@@ -223,14 +223,12 @@ int NotecardConnectionHandler::syncSecretDeviceKey (const String & secret_device
223223
result = NotecardCommunicationError::NOTECARD_ERROR_GENERIC;
224224
} else if (J *req = _notecard.newRequest("var.set")) {
225225
JAddStringToObject(req, "file", NOTEFILE_SECURE_DATABASE);
226-
JAddStringToObject(req, "name", "arduino_iot_cloud_secret_key");
226+
JAddStringToObject(req, "name", "secret_device_key");
227227
if (secret_device_key_.length() > 0) {
228228
JAddStringToObject(req, "text", secret_device_key_.c_str());
229229
}
230-
// Queue the Note when `_keep_alive` is disabled
231-
if (_keep_alive) {
232-
JAddBoolToObject(req, "sync", true);
233-
}
230+
JAddBoolToObject(req, "live", true);
231+
JAddBoolToObject(req, "sync", true);
234232
if (J *rsp = _notecard.requestAndResponse(req)) {
235233
// Check the response for errors
236234
if (NoteResponseError(rsp)) {
@@ -448,7 +446,6 @@ NetworkConnectionState NotecardConnectionHandler::update_handleInit()
448446
}
449447
#endif
450448

451-
#if defined(BOARD_HAS_SECRET_KEY)
452449
// Set database template to support LoRa/Satellite Notecard
453450
if (NetworkConnectionState::INIT == result) {
454451
if (J *req = _notecard.newRequest("note.template")) {
@@ -483,7 +480,6 @@ NetworkConnectionState NotecardConnectionHandler::update_handleInit()
483480
result = NetworkConnectionState::ERROR; // Assume the worst
484481
}
485482
}
486-
#endif
487483

488484
// Set inbound template to support LoRa/Satellite Notecard
489485
if (NetworkConnectionState::INIT == result) {

0 commit comments

Comments
 (0)