mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
temper: improve code-style
This commit is contained in:
parent
2eeca3abda
commit
dbf798f29b
2 changed files with 39 additions and 13 deletions
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue