Skip to content

Commit 3cb8b49

Browse files
committed
chore: Remove vestigial database template from NCH
1 parent bbaabd2 commit 3cb8b49

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

Diff for: src/NotecardConnectionHandler.cpp

-37
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@
3131
#define NOTEFILE_BASE_NAME "arduino_iot_cloud"
3232

3333
// Notecard LoRa requires us to choose an arbitrary port between 1-99
34-
#define NOTEFILE_DATABASE_LORA_PORT 1
3534
#define NOTEFILE_INBOUND_LORA_PORT 2
3635
#define NOTEFILE_OUTBOUND_LORA_PORT 3
3736

3837
// Note that we use "s" versions of the Notefile extensions to ensure that
3938
// traffic always happens on a secure transport
40-
#define NOTEFILE_SECURE_DATABASE NOTEFILE_BASE_NAME ".dbs"
4139
#define NOTEFILE_SECURE_INBOUND NOTEFILE_BASE_NAME ".qis"
4240
#define NOTEFILE_SECURE_OUTBOUND NOTEFILE_BASE_NAME ".qos"
4341

@@ -423,41 +421,6 @@ NetworkConnectionState NotecardConnectionHandler::update_handleInit()
423421
}
424422
#endif
425423

426-
// Set database template to support LoRa/Satellite Notecard
427-
if (NetworkConnectionState::INIT == result) {
428-
if (J *req = _notecard.newRequest("note.template")) {
429-
JAddStringToObject(req, "file", NOTEFILE_SECURE_DATABASE);
430-
JAddStringToObject(req, "format", "compact"); // Support LoRa/Satellite Notecards
431-
JAddIntToObject(req, "port", NOTEFILE_DATABASE_LORA_PORT); // Support LoRa/Satellite Notecards
432-
if (J *body = JAddObjectToObject(req, "body")) {
433-
JAddStringToObject(body, "text", TSTRINGV);
434-
JAddNumberToObject(body, "value", TFLOAT64);
435-
JAddBoolToObject(body, "flag", TBOOL);
436-
if (J *rsp = _notecard.requestAndResponse(req)) {
437-
// Check the response for errors
438-
if (NoteResponseError(rsp)) {
439-
const char *err = JGetString(rsp, "err");
440-
Debug.print(DBG_ERROR, F("%s"), err);
441-
result = NetworkConnectionState::ERROR;
442-
} else {
443-
result = NetworkConnectionState::INIT;
444-
}
445-
JDelete(rsp);
446-
} else {
447-
Debug.print(DBG_ERROR, F("Failed to receive response from Notecard."));
448-
result = NetworkConnectionState::ERROR; // Assume the worst
449-
}
450-
} else {
451-
Debug.print(DBG_ERROR, "Failed to allocate request: note.template:body");
452-
JFree(req);
453-
result = NetworkConnectionState::ERROR; // Assume the worst
454-
}
455-
} else {
456-
Debug.print(DBG_ERROR, "Failed to allocate request: note.template");
457-
result = NetworkConnectionState::ERROR; // Assume the worst
458-
}
459-
}
460-
461424
// Set inbound template to support LoRa/Satellite Notecard
462425
if (NetworkConnectionState::INIT == result) {
463426
if (J *req = _notecard.newRequest("note.template")) {

0 commit comments

Comments
 (0)