1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-05-29 02:45:07 +02:00

Improved door responses

This commit is contained in:
Ralf Ramsauer 2015-09-17 14:50:30 +02:00
parent ad77fbe86b
commit 5af124000b

View File

@ -69,15 +69,20 @@ void Door::_asyncRead()
}
if (recvBuf == 'U') {
// In case that someone pushed the unlock button - just log it.
// No further actions required
_logger(LogLevel::notice, "Someone pushed the unlock button");
}
if (recvBuf == 'L') {
goto out;
} else if (recvBuf == 'L') {
_logger(LogLevel::notice, "Someone pushed the lock button");
_logger(LogLevel::notice, "Locking...");
lock();
goto out;
} else if (recvBuf == 'E') {
_logger(LogLevel::warning, "Someone did an emergency unlock!");
// TODO: Trigger Emergency unlock script
goto out;
}
// TODO EMERGENCY DOOR BUTTON
_byteReady = true;
_receivedCondition.notify_one();