6 #include <Poco/SharedPtr.h>
7 #include <Poco/Timespan.h>
9 #include "core/PollableDevice.h"
10 #include "iqrf/DPAMessage.h"
11 #include "iqrf/DPAProtocol.h"
12 #include "iqrf/IQRFEventFirer.h"
13 #include "iqrf/IQRFMqttConnector.h"
14 #include "model/DeviceID.h"
15 #include "model/ModuleType.h"
16 #include "model/RefreshTime.h"
17 #include "util/Loggable.h"
33 typedef Poco::SharedPtr<IQRFDevice> Ptr;
36 IQRFMqttConnector::Ptr connector,
37 const Poco::Timespan &receiveTimeout,
38 DPAMessage::NetworkAddress address,
42 IQRFEventFirer::Ptr eventFirer);
64 std::list<ModuleType>
modules()
const;
70 uint16_t
HWPID()
const;
71 void setHWPID(uint16_t HWPID);
83 std::string vendorName()
const;
84 std::string productName()
const;
87 void poll(Distributor::Ptr distributor)
override;
99 void probe(
const Poco::Timespan &methodTimeout);
117 uint16_t detectNodeHWPID(
const Poco::Timespan &methodTimeout);
124 uint32_t detectMID(
const Poco::Timespan &methodTimeout);
131 std::list<ModuleType> detectModules(
132 const Poco::Timespan &methodTimeout);
140 const Poco::Timespan &methodTimeout);
146 IQRFMqttConnector::Ptr m_connector;
147 Poco::Timespan m_receiveTimeout;
148 DPAMessage::NetworkAddress m_address;
149 DPAProtocol::Ptr m_protocol;
153 mutable Poco::Timespan m_remainingValueTime;
154 mutable Poco::Timespan m_remainingPeripheralInfoTime;
155 mutable Poco::Timespan m_remaining;
158 std::list<ModuleType> m_modules;
160 std::string m_vendorName;
161 std::string m_productName;
163 IQRFEventFirer::Ptr m_eventFirer;
void probe(const Poco::Timespan &methodTimeout)
Probes information about IQRF device in a network.
Definition: IQRFDevice.cpp:142
Vendor and product name for each paired device. It can be filled from IQRF repository or statically f...
Definition: DPAProtocol.h:29
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
void poll(Distributor::Ptr distributor) override
Perform polling for data and ship them via the given distributor.
Definition: IQRFDevice.cpp:330
Definition: SensorData.h:20
SensorData obtainPeripheralInfo()
Definition: IQRFDevice.cpp:298
IQRFDevice represents information about a particular device from the IQRF network. Each IQRF device is identified by network address. Network address is a unique identifier in IQRF network. Each IQRF device has IQRF transceiver. The MID (Module ID) is globally unique. Each IQRF device can communicate using own or general protocol.
Definition: IQRFDevice.h:31
std::string toString() const
Converts all device parameters into one string for easy viewing.
Definition: IQRFDevice.cpp:98
RefreshTime refresh() const override
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain ...
Definition: IQRFDevice.cpp:325
std::list< ModuleType > modules() const
Supported modules on the device.
Definition: IQRFDevice.cpp:49
DPAProtocol::Ptr protocol() const
Protocol that communicates with the coordinator.
Definition: IQRFDevice.cpp:54
Definition: ModuleID.h:12
uint32_t mid() const
Definition: IQRFDevice.cpp:44
Definition: Loggable.h:19
DeviceID id() const override
Definition: IQRFDevice.cpp:69
SensorData obtainValues()
Definition: IQRFDevice.cpp:271
DPAMessage::NetworkAddress networkAddress() const
Definition: IQRFDevice.cpp:39
uint16_t HWPID() const
Identification of node in the IQRF repository. Device name and manufacturer can be obtained on the ba...
Definition: IQRFDevice.cpp:59
Definition: DeviceID.h:17
PollableDevice is a device that is necessary to poll regularly for data. The polling can take some ti...
Definition: PollableDevice.h:18