From 46cd1838255712cc599a30a81098121aa26d80f5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 8 Mar 2015 19:40:11 +0100 Subject: o Formatting. --- apps/SoilMoisture.cpp | 5 ++--- apps/SoilMoistureIo.cpp | 2 +- apps/apps.cpp | 3 +-- apps/apps.h | 4 ++-- apps/ble-inspect-device.cpp | 4 ++-- apps/sample-convert.cpp | 2 +- apps/sm-get-value.cpp | 14 +++++++------- apps/sm-serial-read.cpp | 4 ++-- 8 files changed, 18 insertions(+), 20 deletions(-) diff --git a/apps/SoilMoisture.cpp b/apps/SoilMoisture.cpp index 0fed8ab..f998d74 100644 --- a/apps/SoilMoisture.cpp +++ b/apps/SoilMoisture.cpp @@ -3,7 +3,6 @@ namespace trygvis { namespace soil_moisture { - #define BLUETOOTH_UUID_INITIALIZER \ { \ 0x00, 0x00, 0x00, 0x00, \ @@ -63,7 +62,7 @@ ByteBuffer createSetUpdateInterval(uint8_t sensor, uint8_t interval_in_seconds) write8(interval_in_seconds); } -SoilMoisture SoilMoisture::create(BluetoothGatt & gatt) { +SoilMoisture SoilMoisture::create(BluetoothGatt &gatt) { gatt.discoverServices(); auto service = gatt.findService(soil_moisture_service); @@ -81,7 +80,7 @@ SoilMoisture SoilMoisture::create(BluetoothGatt & gatt) { return SoilMoisture(gatt, *service, *c); } -SoilMoisture::SoilMoisture(BluetoothGatt & gatt, BluetoothGattService &s, BluetoothGattCharacteristic &c) : +SoilMoisture::SoilMoisture(BluetoothGatt &gatt, BluetoothGattService &s, BluetoothGattCharacteristic &c) : gatt(gatt), s(s), c(c) { } diff --git a/apps/SoilMoistureIo.cpp b/apps/SoilMoistureIo.cpp index d184eab..fe485b3 100644 --- a/apps/SoilMoistureIo.cpp +++ b/apps/SoilMoistureIo.cpp @@ -142,7 +142,7 @@ void SqlSampleOutputStream::write(Sample values) { auto v = *i++; fs += v.first; - vs += "'" + v.second + "'"; + vs += "'" + v.second + "'"; if (i != values.end()) { fs += ","; diff --git a/apps/apps.cpp b/apps/apps.cpp index edfb556..80fae13 100644 --- a/apps/apps.cpp +++ b/apps/apps.cpp @@ -21,7 +21,7 @@ void setup_logging(po::variables_map vm) { config.configure(); } -int launch_app(int argc, char *argv[], app& app) { +int launch_app(int argc, char *argv[], app &app) { po::options_description all("Options"); auto all_options = all.add_options(); @@ -65,7 +65,6 @@ int launch_app(int argc, char *argv[], app& app) { } } - std::string get_hostname() { struct addrinfo hints, *info, *p; // int gai_result; diff --git a/apps/apps.h b/apps/apps.h index 3d82745..e5d712c 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -22,10 +22,10 @@ public: class app { public: - virtual void add_options(po::options_description_easy_init& options) { + virtual void add_options(po::options_description_easy_init &options) { }; - virtual void add_extra_options(po::options_description& options) { + virtual void add_extra_options(po::options_description &options) { }; virtual int main(app_execution &execution) = 0; diff --git a/apps/ble-inspect-device.cpp b/apps/ble-inspect-device.cpp index cdc8375..e4e7113 100644 --- a/apps/ble-inspect-device.cpp +++ b/apps/ble-inspect-device.cpp @@ -7,14 +7,14 @@ using namespace std; using namespace trygvis::bluetooth; -void scan_callback(BluetoothDevice & device) { +void scan_callback(BluetoothDevice &device) { cout << "Inspecting device: " << device.getMac().str() << endl; auto &gatt = device.connectGatt(); gatt.discoverServices(); - vector < BluetoothGattService * > services = gatt.getServices(); + vector services = gatt.getServices(); cout << "Device has " << services.size() << " services" << endl; for (auto &s: services) { diff --git a/apps/sample-convert.cpp b/apps/sample-convert.cpp index fb74fcf..7bc8d0b 100644 --- a/apps/sample-convert.cpp +++ b/apps/sample-convert.cpp @@ -14,7 +14,7 @@ namespace po = boost::program_options; class sample_convert : public app { public: - sample_convert() : table_name(""),input_file(""), input_format(""), + sample_convert() : table_name(""), input_file(""), input_format(""), output_file(""), output_format("") { } diff --git a/apps/sm-get-value.cpp b/apps/sm-get-value.cpp index 2772b55..a61132f 100644 --- a/apps/sm-get-value.cpp +++ b/apps/sm-get-value.cpp @@ -124,14 +124,14 @@ namespace apps { class sm_get_value : public app { public: - void add_options(po::options_description_easy_init& options) override { + void add_options(po::options_description_easy_init &options) override { options - ("help", "produce help message") - ("device", po::value()->required(), "MAC of device to poll") - ("sensor", po::value>(&sensors)->multitoken(), "Sensor to poll, defaults to all") - ("sleep", po::value(&sleepTime)->default_value(0), - "How long to sleep in seconds between each poll. If not give, it will exit after first poll") - ("format", po::value(&format)->default_value(Format::PLAIN), "Output format"); + ("help", "produce help message") + ("device", po::value()->required(), "MAC of device to poll") + ("sensor", po::value>(&sensors)->multitoken(), "Sensor to poll, defaults to all") + ("sleep", po::value(&sleepTime)->default_value(0), + "How long to sleep in seconds between each poll. If not give, it will exit after first poll") + ("format", po::value(&format)->default_value(Format::PLAIN), "Output format"); } diff --git a/apps/sm-serial-read.cpp b/apps/sm-serial-read.cpp index a203847..fee1a8c 100644 --- a/apps/sm-serial-read.cpp +++ b/apps/sm-serial-read.cpp @@ -120,7 +120,7 @@ public: cerr << "port is not open" << endl; } - shared_ptr output; + shared_ptr output; if (format == Format::JSON) { output = make_shared(cout); @@ -133,7 +133,7 @@ public: return EXIT_FAILURE; } - shared_ptr input = make_shared(output); + shared_ptr input = make_shared(output); port_handler(port_name, port, input).run(); -- cgit v1.2.3