6 #include <Poco/Nullable.h>
7 #include <Poco/Timespan.h>
8 #include <Poco/Net/IPAddress.h>
10 #include "model/DeviceID.h"
11 #include "model/ModuleType.h"
12 #include "model/RefreshTime.h"
13 #include "net/MACAddress.h"
29 const std::string &vendor,
30 const std::string &name);
32 template <
typename Container>
33 Builder &modules(
const Container &types)
37 for (
const auto type : types)
38 m_modules.emplace_back(type);
43 Builder &refreshTime(
const Poco::Timespan &time);
47 Builder &name(
const std::string &name);
48 Builder &firmware(
const std::string &firmware);
49 Builder &ipAddress(
const Poco::Net::IPAddress &address);
51 Builder &serialNumber(
const uint64_t serial);
56 Poco::Nullable<DeviceID> m_id;
57 Poco::Nullable<std::string> m_vendor;
58 Poco::Nullable<std::string> m_product;
59 std::list<ModuleType> m_modules;
62 std::string m_firmware;
63 Poco::Nullable<Poco::Net::IPAddress> m_ipAddress;
64 Poco::Nullable<MACAddress> m_macAddress;
65 Poco::Nullable<uint64_t> m_serialNumber;
73 void setVendor(
const std::string &vendor);
74 std::string vendor()
const;
76 void setProductName(
const std::string &name);
77 std::string productName()
const;
79 void setDataTypes(
const std::list<ModuleType> &types);
80 std::list<ModuleType> dataTypes()
const;
96 void setName(
const std::string &name);
97 std::string name()
const;
99 void setFirmware(
const std::string &firmware);
100 std::string firmware()
const;
102 void setIPAddress(
const Poco::Net::IPAddress &ipAddress);
103 Poco::Nullable<Poco::Net::IPAddress> ipAddress()
const;
105 void setMACAddress(
const MACAddress &macAddress);
106 Poco::Nullable<MACAddress> macAddress()
const;
108 void setSerialNumber(uint64_t serial);
109 Poco::Nullable<uint64_t> serialNumber()
const;
111 std::string toString()
const;
112 std::string toPrettyString()
const;
115 static std::string normalizeName(
const std::string& bytes);
119 std::string m_vendor;
120 std::string m_productName;
121 std::list<ModuleType> m_dataTypes;
124 std::string m_firmware;
125 Poco::Nullable<Poco::Net::IPAddress> m_ipAddress;
126 Poco::Nullable<MACAddress> m_macAddress;
127 Poco::Nullable<uint64_t> m_serialNumber;
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
Definition: MACAddress.h:8
RefreshTime refreshTime() const
Definition: DeviceDescription.cpp:181
Definition: DeviceID.h:17
The class wraps information about a device's type. It describes its properties and provided sensor ty...
Definition: DeviceDescription.h:21
Definition: DeviceDescription.h:23