6 #include <Poco/Mutex.h>
7 #include <Poco/Timespan.h>
9 #include "belkin/BelkinWemoBulb.h"
10 #include "belkin/BelkinWemoDevice.h"
11 #include "belkin/BelkinWemoDimmer.h"
12 #include "belkin/BelkinWemoLink.h"
13 #include "belkin/BelkinWemoSwitch.h"
14 #include "core/AbstractSeeker.h"
15 #include "core/DeviceManager.h"
16 #include "core/PollingKeeper.h"
17 #include "loop/StopControl.h"
18 #include "model/DeviceID.h"
19 #include "model/RefreshTime.h"
20 #include "net/MACAddress.h"
21 #include "util/AsyncWork.h"
33 typedef Poco::SharedPtr<BelkinWemoSeeker> Ptr;
46 void setDevicePoller(DevicePoller::Ptr poller);
51 void setUPnPTimeout(
const Poco::Timespan &timeout);
52 void setHTTPTimeout(
const Poco::Timespan &timeout);
53 void setRefresh(
const Poco::Timespan &refresh);
56 void handleAccept(
const DeviceAcceptCommand::Ptr cmd)
override;
60 const Poco::Timespan &timeout)
override;
65 const Poco::Timespan &timeout)
override;
67 void searchPairedDevices();
74 std::vector<BelkinWemoSwitch::Ptr> seekSwitches(
const StopControl&
stop);
76 std::vector<BelkinWemoDimmer::Ptr> seekDimmers(
const StopControl&
stop);
78 void processNewDevice(BelkinWemoDevice::Ptr newDevice);
81 Poco::FastMutex m_linksMutex;
82 Poco::FastMutex m_pairedMutex;
84 std::map<MACAddress, BelkinWemoLink::Ptr> m_links;
85 std::map<DeviceID, BelkinWemoDevice::Ptr> m_devices;
89 Poco::Timespan m_httpTimeout;
90 Poco::Timespan m_upnpTimeout;
AsyncWork< double >::Ptr startSetValue(const DeviceID &id, const ModuleID &module, const double value, const Poco::Timespan &timeout) override
Starts set-value operation in a technology specific way. The method is always called inside a critica...
Definition: BelkinWemoDeviceManager.cpp:208
void eraseUnusedLinks()
Erases the links which don't care any bulb.
Definition: BelkinWemoDeviceManager.cpp:146
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
void handleAccept(const DeviceAcceptCommand::Ptr cmd) override
Generic handler of the DeviceAcceptCommand. It might be helpful to override this method in case we ne...
Definition: BelkinWemoDeviceManager.cpp:196
Provides searching belkin wemo devices on network in own thread.
Definition: BelkinWemoDeviceManager.h:31
Definition: BelkinWemoDeviceManager.h:25
PollingKeeper takes care of devices that are being polled. It cancels all polled devices it manages u...
Definition: PollingKeeper.h:17
AsyncWork is an interface allowing to wait until an asynchronous operation finishes. It is also possible to force-stop it by calling cancel().
Definition: AsyncWork.h:21
AbstractSeeker represents an asynchronous process that seeks for new devices in a certain network...
Definition: AbstractSeeker.h:25
StopControl implements the stop mechanism generically.
Definition: StopControl.h:12
Definition: ModuleID.h:12
AsyncWork< std::set< DeviceID > >::Ptr startUnpair(const DeviceID &id, const Poco::Timespan &timeout) override
Starts device unpair process in a technology-specific way. This method is always called inside a crit...
Definition: BelkinWemoDeviceManager.cpp:170
Poco::Timespan duration() const
Definition: AbstractSeeker.cpp:17
Definition: DeviceManager.h:48
Definition: DeviceID.h:17
AsyncWork::Ptr startDiscovery(const Poco::Timespan &timeout) override
Starts device discovery process in a technology-specific way. This method is always called inside a c...
Definition: BelkinWemoDeviceManager.cpp:163
void stop() override
Definition: BelkinWemoDeviceManager.cpp:79