SinricPro Library
|
Public Types | |
using | SetRangeValueCallback = std::function< bool(const String &, int &)> |
Callback definition for onRangeValue function. More... | |
using | GenericSetRangeValueCallback = std::function< bool(const String &, const String &, int &)> |
Callback definition for onRangeValue function on a specific instance. More... | |
using | AdjustRangeValueCallback = std::function< bool(const String &, int &)> |
Callback definition for onAdjustRangeValue function. More... | |
using | GenericAdjustRangeValueCallback = std::function< bool(const String &, const String &, int &)> |
Callback definition for onAdjustRangeValue function on a specific instance for custom devices. More... | |
Public Member Functions | |
void | onRangeValue (SetRangeValueCallback cb) |
Set callback function for setRangeValue request. More... | |
void | onRangeValue (const String &instance, GenericSetRangeValueCallback cb) |
Set callback function for setRangeValue request on a specific instance (custom device) More... | |
void | onAdjustRangeValue (AdjustRangeValueCallback cb) |
Set callback function for adjustRangeValue request. More... | |
bool | sendRangeValueEvent (int rangeValue, String cause="PHYSICAL_INTERACTION") |
Send rangeValue event to report curent rangeValue to SinricPro server. More... | |
bool | sendRangeValueEvent (const String &instance, int rangeValue, String cause="PHYSICAL_INTERACTION") |
Send rangeValue event to report curent rangeValue to SinricPro server for a specific instance (custom device) More... | |
using AdjustRangeValueCallback = std::function<bool(const String &, int &)> |
Callback definition for onAdjustRangeValue function.
Gets called when device receive a adjustRangeValue
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | rangeValue | Integer -3..3 delta value for range value have to change |
[out] | rangeValue | Integer 3..3 returning the absolute range value |
true | request handled properly |
false | request was not handled properly because of some error |
using GenericAdjustRangeValueCallback = std::function<bool(const String&, const String&, int&)> |
Callback definition for onAdjustRangeValue function on a specific instance for custom devices.
Gets called when device receive a adjustRangeValue
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | instance | String instance name |
[in] | rangeValue | Integer -3..3 delta value for range value have to change |
[out] | rangeValue | Integer 3..3 returning the absolute range value |
true | request handled properly |
false | request was not handled properly because of some error |
using GenericSetRangeValueCallback = std::function<bool(const String &, const String &, int &)> |
Callback definition for onRangeValue function on a specific instance.
Gets called when device receive a setRangeValue
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | instance | String instance name |
[in] | rangeValue | Integer 0..3 for range value device has to be set |
[out] | rangeValue | Integer 0..3 returning the current range value |
true | request handled properly |
false | request was not handled properly because of some error |
using SetRangeValueCallback = std::function<bool(const String &, int &)> |
Callback definition for onRangeValue function.
Gets called when device receive a setRangeValue
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | rangeValue | Integer 0..3 for range value device has to be set |
[out] | rangeValue | Integer 0..3 returning the current range value |
true | request handled properly |
false | request was not handled properly because of some error |
void onAdjustRangeValue | ( | AdjustRangeValueCallback | cb | ) |
Set callback function for adjustRangeValue
request.
cb | Function pointer to a AdjustRangeValueCallback function |
void onRangeValue | ( | const String & | instance, |
GenericSetRangeValueCallback | cb | ||
) |
Set callback function for setRangeValue
request on a specific instance (custom device)
instance | String instance name (custom device) |
cb | Function pointer to a GenericSetRangeValueCallback function |
void onRangeValue | ( | SetRangeValueCallback | cb | ) |
Set callback function for setRangeValue
request.
cb | Function pointer to a SetRangeValueCallback function |
bool sendRangeValueEvent | ( | const String & | instance, |
int | rangeValue, | ||
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send rangeValue
event to report curent rangeValue to SinricPro server for a specific instance (custom device)
instance | String instance name |
rangeValue | Value between 0..3 |
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 |
bool sendRangeValueEvent | ( | int | rangeValue, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send rangeValue
event to report curent rangeValue to SinricPro server.
rangeValue | Value between 0..3 |
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 |