DeviceStatusFetcher is responsible for fetching pairing state of devices for the registered status handlers. The fetching is performed asynchronously and independently resulting in calling to the method DeviceStatusHandler::handleRemoteStatus() on the appropriate handlers.
More...
#include <DeviceStatusFetcher.h>
|
enum | FetchStatus { NOTHING,
WOULD_REPEAT,
ACTIVE
} |
| Denote certain situations of the status fetching.
|
|
|
FetchStatus | fetchUndone () |
| Determine status handlers for which no fully successful request was made and dispatch ServerDeviceListCommand for them. More...
|
|
PrefixAnswer::Ptr | handleDirtyAnswer (Answer::Ptr answer) |
| Check status of the given answer and if it is not pending and castable to PrefixAnswer, it performs cast and returns it. More...
|
|
std::set
< DeviceStatusHandler::Ptr > | matchHandlers (const PrefixAnswer::Ptr answer) const |
|
void | processAnswer (PrefixAnswer::Ptr answer, std::set< DeviceStatusHandler::Ptr > handler) |
| Process results of the given answer and the matching status handler. When any of the results is unsuccessful, all the answer is considered unsuccessful and it would be marked for repeated fetch. More...
|
|
void | collectPaired (std::set< DeviceID > &paired, const std::vector< DeviceID > &received, const DevicePrefix &prefix) const |
| Process paired devices as given in a single Answer result. Only devices matching the given prefix would be used. Other devices are considered as a bug somewhere.
|
|
DeviceStatusFetcher is responsible for fetching pairing state of devices for the registered status handlers. The fetching is performed asynchronously and independently resulting in calling to the method DeviceStatusHandler::handleRemoteStatus() on the appropriate handlers.
Determine status handlers for which no fully successful request was made and dispatch ServerDeviceListCommand for them.
- Returns
- whether there something to do
DeviceStatusFetcher::PrefixAnswer::Ptr DeviceStatusFetcher::handleDirtyAnswer |
( |
Answer::Ptr |
answer | ) |
|
|
protected |
Check status of the given answer and if it is not pending and castable to PrefixAnswer, it performs cast and returns it.
- Returns
- instance of PrefixAnswer if it should be processed or null
set< DeviceStatusHandler::Ptr > DeviceStatusFetcher::matchHandlers |
( |
const PrefixAnswer::Ptr |
answer | ) |
const |
|
protected |
- Returns
- status handler matching the given answer (by prefix)
void DeviceStatusFetcher::processAnswer |
( |
PrefixAnswer::Ptr |
answer, |
|
|
std::set< DeviceStatusHandler::Ptr > |
handler |
|
) |
| |
|
protected |
Process results of the given answer and the matching status handler. When any of the results is unsuccessful, all the answer is considered unsuccessful and it would be marked for repeated fetch.
If there is at least one successful result, the method DeviceStatusHandler::handleRemoteStatus() is called once on the given handler as a result of the answer processing.
void DeviceStatusFetcher::stop |
( |
| ) |
|
|
overridevirtual |
The documentation for this class was generated from the following files:
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/core/DeviceStatusFetcher.h
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/core/DeviceStatusFetcher.cpp