 
 // Function called on door state change
 void doorStateChange() {
+  Serial.println("Door state changed...");
   // Check contact state. We assume a normally closed switch.
   boolean newContact = (digitalRead(MAGNETIC_SWITCH_PIN) == HIGH);
   // Set the signaling LED

}

// Print a diagnostic report on the serial line and ask for a new device number
void diagnotic() {
  // Entering DIAG mode
  digitalWrite(LED_PIN, HIGH);
  Serial.println(" *** DIAG report ***");
  Serial.print("type of device: ");
  Serial.println(DOOR_SENSOR);
  Serial.print("device id: ");

unsigned long g_previous_millis = 0;
// ledState used to set the LED
int ledState = LOW;
// Interrupt type
int NO_INTERRUPT = 0;
int DIAG_INTERRUPT = NO_INTERRUPT + 1;
int DOOR_INTERRUPT = DIAG_INTERRUPT + 1;
// Interrupt variable (used to know which interrupt was striggered in the loop)
volatile int g_interrupt_id = NO_INTERRUPT;

// Interrupt called when presing the diag switch
void diagnoticInterrupt() {
  g_interrupt_id = DIAG_INTERRUPT;
}

// Interrupt called when magentic switch change its state
void doorInterrupt() {
  g_interrupt_id = DOOR_INTERRUPT;
}

void setupRFDevice() {
  // Transmitter is connected to Arduino Pin #10
