aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/SoilMoistureIo.cpp4
-rw-r--r--apps/sample-timestamp.cpp3
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/SoilMoistureIo.cpp b/apps/SoilMoistureIo.cpp
index 7d8f5bb..66e1dce 100644
--- a/apps/SoilMoistureIo.cpp
+++ b/apps/SoilMoistureIo.cpp
@@ -12,6 +12,10 @@ using namespace std;
using json = nlohmann::json;
void VectorSampleOutputStream::write(SampleRecord const &sample) {
+ if (sample.empty()) {
+ return;
+ }
+
samples.emplace_back(sample);
}
diff --git a/apps/sample-timestamp.cpp b/apps/sample-timestamp.cpp
index 6672091..0affd36 100644
--- a/apps/sample-timestamp.cpp
+++ b/apps/sample-timestamp.cpp
@@ -107,7 +107,7 @@ public:
return EXIT_FAILURE;
}
- const int buffer_size = 100;
+ const int buffer_size = 1024;
input.seekg(-buffer_size, ios_base::end);
@@ -146,6 +146,7 @@ public:
o<string> s = sample.at(relative_key);
if (!s) {
cerr << "Missing key '" + relative_name + "'." << endl;
+ cerr << "Found " << sample_buffer->samples.size() << " samples." << endl;
cerr << "keys: " << sample.to_string() << endl;
return EXIT_FAILURE;
}