From 79532b1596cff69063bc2ad21cc9a681610c28fc Mon Sep 17 00:00:00 2001 From: "Zachary J. Fields" Date: Thu, 25 Jul 2024 07:01:15 -0500 Subject: [PATCH] fix: Address PR Feedback --- library.properties | 2 +- src/Arduino_NotecardConnectionHandler.cpp | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/library.properties b/library.properties index 1ca499d..3b154a4 100644 --- a/library.properties +++ b/library.properties @@ -7,4 +7,4 @@ paragraph=Originally part of ArduinoIoTCloud category=Communication url=https://github.com/arduino-libraries/Arduino_ConnectionHandler architectures=samd,esp32,esp8266,mbed,megaavr,mbed_nano,mbed_portenta,mbed_nicla,mbed_opta,mbed_giga,renesas_portenta,renesas_uno,mbed_edge,stm32 -depends=Arduino_DebugUtils, Blues Wireless Notecard (>=1.6.0), WiFi101, WiFiNINA, MKRGSM, MKRNB, MKRWAN +depends=Arduino_DebugUtils, WiFi101, WiFiNINA, MKRGSM, MKRNB, MKRWAN, Blues Wireless Notecard (>=1.6.0) diff --git a/src/Arduino_NotecardConnectionHandler.cpp b/src/Arduino_NotecardConnectionHandler.cpp index 18012e8..59e675d 100644 --- a/src/Arduino_NotecardConnectionHandler.cpp +++ b/src/Arduino_NotecardConnectionHandler.cpp @@ -202,7 +202,7 @@ const String & NotecardConnectionHandler::syncArduinoDeviceId (const String & de } } - if (_keep_alive && initiateNotehubSync()) { + if (initiateNotehubSync()) { Debug.print(DBG_ERROR, F("Failed to sync Arduino Device ID.")); } } @@ -223,14 +223,12 @@ int NotecardConnectionHandler::syncSecretDeviceKey (const String & secret_device result = NotecardCommunicationError::NOTECARD_ERROR_GENERIC; } else if (J *req = _notecard.newRequest("var.set")) { JAddStringToObject(req, "file", NOTEFILE_SECURE_DATABASE); - JAddStringToObject(req, "name", "arduino_iot_cloud_secret_key"); + JAddStringToObject(req, "name", "secret_device_key"); if (secret_device_key_.length() > 0) { JAddStringToObject(req, "text", secret_device_key_.c_str()); } - // Queue the Note when `_keep_alive` is disabled - if (_keep_alive) { - JAddBoolToObject(req, "sync", true); - } + JAddBoolToObject(req, "live", true); + JAddBoolToObject(req, "sync", true); if (J *rsp = _notecard.requestAndResponse(req)) { // Check the response for errors if (NoteResponseError(rsp)) { @@ -448,7 +446,6 @@ NetworkConnectionState NotecardConnectionHandler::update_handleInit() } #endif -#if defined(BOARD_HAS_SECRET_KEY) // Set database template to support LoRa/Satellite Notecard if (NetworkConnectionState::INIT == result) { if (J *req = _notecard.newRequest("note.template")) { @@ -483,7 +480,6 @@ NetworkConnectionState NotecardConnectionHandler::update_handleInit() result = NetworkConnectionState::ERROR; // Assume the worst } } -#endif // Set inbound template to support LoRa/Satellite Notecard if (NetworkConnectionState::INIT == result) {