SinricPro Library
|
Device to control a garage door. More...
Public Types | |
typedef std::function< bool(const String &, bool &)> | DoorStateCallback |
Callback definition for onDoorState function. More... | |
typedef std::function< bool(const String &, bool &)> | PowerStateCallback |
Callback definition for onPowerState function. More... | |
Public Member Functions | |
void | onDoorState (DoorStateCallback cb) |
Set callback function for onDoorState request. More... | |
bool | sendDoorStateEvent (bool mode, String cause="PHYSICAL_INTERACTION") |
Send DoorState event to update actual door state on SinricPro Server. More... | |
virtual void | onPowerState (PowerStateCallback cb) |
Set callback function for powerState request. More... | |
bool | sendPowerStateEvent (bool state, String cause="PHYSICAL_INTERACTION") |
Send setPowerState event to SinricPro Server indicating actual power state. More... | |
Device to control a garage door.
Supporting
typedef std::function<bool(const String&, bool&)> DoorStateCallback |
Callback definition for onDoorState function.
Gets called when device receive a open
or close
request
[in] | deviceId | String which contains the ID of device |
[in] | doorState | false = open, device is requested to open the garage door true = close, device is requested to close the garage door |
[out] | doorState | bool with actual state false = open, true = closed |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Callback definition for onPowerState function.
Gets called when device receive a setPowerState
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | state | true = device is requested to turn on false = device is requested to turn off |
[out] | state | true = device has been turned on false = device has been turned off |
true | request handled properly |
false | request was not handled properly because of some error |
void onDoorState | ( | DoorStateCallback | cb | ) |
Set callback function for onDoorState
request.
cb | Function pointer to a onDoorState function |
|
virtualinherited |
Set callback function for powerState
request.
cb | Function pointer to a PowerStateCallback function |
bool sendDoorStateEvent | ( | bool | state, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send DoorState
event to update actual door state on SinricPro Server.
state | bool true = close false = open |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
|
inherited |
Send setPowerState
event to SinricPro Server indicating actual power state.
state | true = device turned on false = device turned off |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |