 int soundDelayTimeout = 0;
 
 int lockTransitionTimeTimeout = 0;
+int doorServerRevertTimeout = 0;
+
 int udpResponseTimeout = 0;
 
 int lastCardChkTimeout = 0;


	// processing reed switch events
	static unsigned long reedEvent = 0;
	bool door = digitalRead(pinReedSwitch);
	if (previousDoorState != door)
	{
		unsigned long time = millis() - reedEvent;

		if (door == close)
		{
			lockDoor();
		}
		if (door == open)
		{
			isDoorLocked = false;
		}

		if (time > 20)
		{
			// sending notification about door state
			udp.beginPacket(srvIp, 10000);
			char buf[12];
			int len = snprintf(buf, 12, "^%d|%08ld", door == close ? 0 : 1, time);
			udp.write((uint8_t*)buf, len);
			udp.endPacket();
		}

		reedEvent = millis();
		previousDoorState = door;
	}

inline int bufferIndex(int index){

				servo.detach();
		}

		if (doorServerRevertTimeout)
			doorServerRevertTimeout--;

		if (udpResponseTimeout)
			udpResponseTimeout--;

