 	servo.write(angle);
 	lockTransitionTimeTimeout = lockTransitionTime;
 }
+void servoDoTime(int angle, int time)
+{
+	servo.attach(pinServo);
+	servo.write(angle);
+	lockTransitionTimeTimeout = time;
+}
 void unlockDoor()
 {
 	if (!isDoorLocked)
 		return;
-	servoDo(clockwise);
+	servoDo(servoUnlockAngle);
 	isDoorLocked = false;
 }
 void unlockDoorForce()
 {
-	servoDo(clockwise);
+	servoDo(servoUnlockAngle);
 	isDoorLocked = false;
 }
 void lockDoor()
 {
 	if (isDoorLocked)
 		return;
-	servoDo(counterClockwise);
+	servoDo(servoLockAngle);
 	isDoorLocked = true;
+	doorServerRevertTimeout = 3000;
 }
 
 void cardAccepted()


	// 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--;

