 // serial port)
 //
 static void doReport() {
+  
+  createReport();
+  rf12_sleep(RF12_WAKEUP);
+  rf12_sendNow(0, buffer, strlen(buffer));
+  rf12_sendWait(RADIO_SYNC_MODE);
+  rf12_sleep(RF12_SLEEP);
+  blink_led(DPIN_RF_LED, LED_DELAY);
+
   #if SERIAL
     Serial.print("FREEZER ");
     Serial.print((int) sensorData.light);
     Serial.print(' ');
-    Serial.print((int) sensorData.openDoor);
+    Serial.print((int) sensorData.door);
     Serial.print(' ');
-    Serial.print((int) sensorData.tempInside);
+    Serial.print((int) sensorData.tempIn);
     Serial.print(' ');
-    Serial.print((int) sensorData.tempOutside);
+    Serial.print((int) sensorData.tempOut);
+    #if DEBUG
+      Serial.print(" - MSG [");
+      Serial.print(buffer);
+      Serial.print("]");
+    #endif
     Serial.println();
     serialFlush();
   #endif


// container for sensor data
SensorData sensorData;

// has to be defined because we're using the watchdog for low-power waiting
ISR(WDT_vect) { Sleepy::watchdogEvent(); }

#define REPORT_EVERY    2   // report every N measurement cycles
#define SMOOTH          3   // smoothing factor used for running averages

#define NODEID          2       // node ID used for this unit
#define NETWORKID       99
#define GATEWAYID       1
#define FREQUENCY       RF12_915MHZ

#define BUFFER_SIZE     128

// set the sync mode to 2 if the fuses are still the Arduino default
// mode 3 (full powerdown) can only be used with 258 CK startup fuses
#define RADIO_SYNC_MODE 2

enum { MEASURE, REPORT, TASK_END };

//static word schedbuf[TASK_END];
