       network.read(rxheader,&payload,sizeof(payload));
       init_transmit=false;
       init_loop_counter=0;
-      txheader.type=rxheader.type;
-      switch (rxheader.type) {
-        case 111: {
-        // Init des Sleeptimers
-          sleeptime=payload.value;
-          break; }
-        case 112: {
-          // radio on (=1) or off (=0) when sleep
-          if (payload.value > 0.5) radiomode = radio_listen; else radiomode=radio_sleep;
-          break; }
-        case 118: {
-          init_finished=true;
-          break; }
-        default: {
-            // nothing right now
-          } 
-      }
-      //returns every message
-      network.write(txheader,&payload,sizeof(payload));
+      action_loop(); 
     }
     sleep4ms(30);
     init_loop_counter--;


// Network uses that radio
RF24Network network(radio);

void setup(void) {
  pinMode(STATUSLED, OUTPUT);     

#include <DallasTemperature.h>
#include <LCD5110_Graph.h>

ISR(WDT_vect) { watchdogEvent(); }

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
 
