//RFID EVENT HANDLER
        private void RfidDetected(object sender, RFIDEventArgs e)
        {
            switch (_state)
            {
            case LadeskabState.Available:
                // Check for ladeforbindelse
                if (_charger.connected() && e.RFID > 0 && e.RFID <= 10000)
                {
                    _door.LockDoor();
                    _charger.startCharging();
                    _oldId = e.RFID;
                    _log.LockerLocklog(_oldId);
                    _display.StatusDoorLocked();
                    _state = LadeskabState.Locked;
                }
                else
                {
                    _display.FejlInPhoneConnection();
                }

                break;

            case LadeskabState.DoorOpen:
                // Ignore
                throw new System.Exception("ERROR! DOOR IS OPEN!!!!");

            case LadeskabState.Locked:
                // Check for correct ID
                CheckId(_oldId, e.RFID);

                break;
            }
        }//end RFID detected
Beispiel #2
0
 protected virtual void OnReadRFID(RFIDEventArgs e)
 {
     RFIDDetectedEvent?.Invoke(this, e);
 }
Beispiel #3
0
 protected virtual void OnRFIDChanged(RFIDEventArgs e)
 {
     RFIDChangedEvent?.Invoke(this, e);
 }
Beispiel #4
0
 public void handleRFIDChanged(object sender, RFIDEventArgs e)
 {
     RfidDetected(e.RFID_ID);
 }