Skip to content

Commit

Permalink
fix: Address PR Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
zfields committed Jul 25, 2024
1 parent cdc1938 commit 79532b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 4 additions & 8 deletions src/Arduino_NotecardConnectionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
}
}
Expand All @@ -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)) {
Expand Down Expand Up @@ -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")) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 79532b1

Please sign in to comment.