From f131953bfb464fcdc882594eec8471b96bd638e9 Mon Sep 17 00:00:00 2001 From: Malaurie Bernard <mbernard@kinouby> Date: Wed, 19 Jul 2023 12:19:33 +0200 Subject: [PATCH] Add serial messages to view JSon file sizes --- syringe.cpp | 6 ++++-- syringefilled.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/syringe.cpp b/syringe.cpp index bdcc642..21e2df5 100644 --- a/syringe.cpp +++ b/syringe.cpp @@ -98,8 +98,10 @@ void Syringe :: write_Json () { InterruptLock lock; //useful thanks to its constructor (so a is not visible in the code) File f = filesystem->open("syringe_json", "w"); //Creation du fichier -serializeJson(syringe_json, f); //remettre f a la plce de json - +size_t a = serializeJson(syringe_json, f); //remettre f a la plce de json +Serial.println("Taille de syringe_json"); +Serial.println(a); +f.close(); } //useful in setup of pousse-seringue.cpp(to check at the begining what has already been saved) and web.cpp via a button to recover data diff --git a/syringefilled.cpp b/syringefilled.cpp index 0e6a3da..aeaeacb 100644 --- a/syringefilled.cpp +++ b/syringefilled.cpp @@ -336,8 +336,10 @@ void SyringeFilled :: write_Json () { InterruptLock lock; //useful thanks to its constructor (so a is not visible in the code) File f = filesystem->open("syringe_filled_json", "w"); //Creation du fichier -serializeJson(syringe_filled_json, f); - +size_t a = serializeJson(syringe_filled_json, f); +Serial.println("Taille de syringe_filled_json"); +Serial.println(a); +f.close(); } //useful in setup of pousse-seringue.cpp(to check at the begining what has already been saved) and web.cpp via a button to recover data -- GitLab