diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-08 19:38:15 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-08 19:38:15 +0100 |
commit | eecddf878f98bb921622a5a5bb2600aedb5a53fa (patch) | |
tree | 36c788ba073033e1ad1a2914b704a45f4d8c7ccd /apps/sm-serial-read.cpp | |
parent | 552b997007a24943429488a3cc46c3e649316947 (diff) | |
download | ble-toys-eecddf878f98bb921622a5a5bb2600aedb5a53fa.tar.gz ble-toys-eecddf878f98bb921622a5a5bb2600aedb5a53fa.tar.bz2 ble-toys-eecddf878f98bb921622a5a5bb2600aedb5a53fa.tar.xz ble-toys-eecddf878f98bb921622a5a5bb2600aedb5a53fa.zip |
o Improved SQL output.
Diffstat (limited to 'apps/sm-serial-read.cpp')
-rw-r--r-- | apps/sm-serial-read.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/apps/sm-serial-read.cpp b/apps/sm-serial-read.cpp index 955d262..a203847 100644 --- a/apps/sm-serial-read.cpp +++ b/apps/sm-serial-read.cpp @@ -120,23 +120,14 @@ public: cerr << "port is not open" << endl; } - auto field_names = vector<string>({ - "hostname", - "device_type", - "device", - "timestamp", - "sensor", - "value" - }); - shared_ptr<SampleOutputStream> output; if (format == Format::JSON) { - output = make_shared<JsonSampleOutputStream>(cout, field_names); + output = make_shared<JsonSampleOutputStream>(cout); } else if (format == Format::SQL) { - output = make_shared<SqlSampleOutputStream>(cout, field_names); + output = make_shared<SqlSampleOutputStream>(cout, "raw"); } else if (format == Format::PLAIN) { - output = make_shared<CsvSampleOutputStream>(cout, field_names); + output = make_shared<CsvSampleOutputStream>(cout); } else { cerr << "Unsupported format: " << boost::lexical_cast<string>(format) << endl; return EXIT_FAILURE; |