OZWCommand handles OpenZWave command management. It allows to request a command to be executed and takes care of race conditions.
More...
#include <OZWCommand.h>
|
enum | Type { NONE,
INCLUSION,
REMOVE_NODE
} |
|
|
| OZWCommand (OZWNetwork &ozw) |
|
Type | type () const |
|
bool | wasRequested () const |
|
bool | isRunning () const |
|
bool | isCancelling () const |
|
void | request (Type type, uint32_t home) |
| Request the given type of command to execute in the context of the given Z-Wave home ID. More...
|
|
bool | cancelIf (Type type, const Poco::Timespan &timeout) |
| Cancel the current command if it is of the given type. This allows to cancel e.g. INCLUSION without knowing whether INCLUSION is currently running. The cancel operation blocks at least for the given timeout. If the timeout exceeds, the cancelling operation is stopped. More...
|
|
|
void | onNormal () |
|
void | onStarted () |
|
void | onWaitUser () |
|
void | onInProgress () |
|
void | onSleeping () |
|
void | onCancelled () |
|
void | onError (OpenZWave::Driver::ControllerError error) |
|
void | onFailed () |
|
void | onSuccess () |
|
void | onNodeOK () |
|
void | onNodeFailed () |
|
|
static void | handle (OpenZWave::Driver::ControllerState state, OpenZWave::Driver::ControllerError error, void *context) |
|
OZWCommand handles OpenZWave command management. It allows to request a command to be executed and takes care of race conditions.
bool OZWCommand::cancelIf |
( |
Type |
type, |
|
|
const Poco::Timespan & |
timeout |
|
) |
| |
Cancel the current command if it is of the given type. This allows to cancel e.g. INCLUSION without knowing whether INCLUSION is currently running. The cancel operation blocks at least for the given timeout. If the timeout exceeds, the cancelling operation is stopped.
- Returns
- true if the given type matches the currently running command and the cancel has succeededl
- Parameters
-
type | of operation to be cancelled |
timeout | to block at maximum (must be at least 1 ms) |
- Exceptions
-
InvalidArgumentException | if the given timeout is invalid |
IllegalStateException | when the command is already being cancelled |
IllegalStateException | when no command has been requested |
bool OZWCommand::isCancelling |
( |
| ) |
const |
- Returns
- true if the current command is being cancelled (this can take some time)
bool OZWCommand::isRunning |
( |
| ) |
const |
- Returns
- true if a command has been requested and is already in progress (running)
void OZWCommand::request |
( |
Type |
type, |
|
|
uint32_t |
home |
|
) |
| |
Request the given type of command to execute in the context of the given Z-Wave home ID.
- Exceptions
-
IllegalStateException | when a command is already requested or running |
IllegalStateException | when the command has failed to start |
OZWCommand::Type OZWCommand::type |
( |
| ) |
const |
- Returns
- type of command that is currently in progress
bool OZWCommand::wasRequested |
( |
| ) |
const |
- Returns
- true if a command has been requested and did not finished yet
The documentation for this class was generated from the following files:
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/zwave/OZWCommand.h
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/zwave/OZWCommand.cpp