From dbf798f29b589da407c47971927d96e08ddf1303 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 9 Jul 2021 19:07:55 +0200 Subject: [PATCH] temper: improve code-style --- include/villas/nodes/temper.hpp | 28 +++++++++++++++++++++------- include/villas/usb.hpp | 24 ++++++++++++++++++------ 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/include/villas/nodes/temper.hpp b/include/villas/nodes/temper.hpp index 1a9187c83..e7c5ceae0 100644 --- a/include/villas/nodes/temper.hpp +++ b/include/villas/nodes/temper.hpp @@ -62,10 +62,14 @@ public: void close(); virtual int getNumSensors() const - { return 1; } + { + return 1; + } virtual bool hasHumiditySensor() const - { return false; }; + { + return false; + }; void read(struct sample *smp); }; @@ -81,7 +85,9 @@ public: static bool match(struct libusb_device *dev); static std::string getName() - { return "TEMPer1"; } + { + return "TEMPer1"; + } }; class TEMPer2Device : public TEMPer1Device { @@ -95,10 +101,14 @@ public: static bool match(struct libusb_device *dev); static std::string getName() - { return "TEMPer2"; } + { + return "TEMPer2"; + } virtual int getNumSensors() const - { return 2; } + { + return 2; + } }; class TEMPerHUMDevice : public TEMPerDevice { @@ -112,10 +122,14 @@ public: static bool match(struct libusb_device *dev); static std::string getName() - { return "TEMPerHUM"; } + { + return "TEMPerHUM"; + } virtual bool hasHumiditySensor() const - { return true; } + { + return true; + } }; struct temper { diff --git a/include/villas/usb.hpp b/include/villas/usb.hpp index b059383bd..0bbd4f67c 100644 --- a/include/villas/usb.hpp +++ b/include/villas/usb.hpp @@ -94,22 +94,34 @@ public: { } const struct libusb_device_descriptor & getDescriptor() const - { return desc; } + { + return desc; + } int getBus() const - { return libusb_get_bus_number(device); } + { + return libusb_get_bus_number(device); + } int getPort() const - { return libusb_get_port_number(device); } + { + return libusb_get_port_number(device); + } std::string getManufacturer() const - { return getStringDescriptor(desc.iManufacturer); } + { + return getStringDescriptor(desc.iManufacturer); + } std::string getProduct() const - { return getStringDescriptor(desc.iProduct); } + { + return getStringDescriptor(desc.iProduct); + } std::string getSerial() const - { return getStringDescriptor(desc.iSerialNumber); } + { + return getStringDescriptor(desc.iSerialNumber); + } bool match(const Filter *flt) const; };