Callback definition for onDoorState function.
Gets called when device receive a open
or close
request
- Parameters
-
[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 |
- Returns
- the success of the request
- Return values
-
true | request handled properly |
false | request was not handled properly because of some error |
Example-Code
bool onDoorState(
const String &deviceId,
bool &doorState) {
Serial.printf("Device %s garage door is now %s\r\n", deviceId.c_str(), doorState?"closed":"open");
return true;
}
void onDoorState(DoorCallback cb)
Set callback function for onDoorState request.
Definition: DoorController.h:48