 }
 
 
-/*
- * Record relevant sensor data for programatic usage
- */
+/*******************************************************************************
+ * Program handler for processing incoming sensor data
+ */
+
+boolean program_sensor_data_init(msg_program_t *msg,
+                                 program_tracker_t *tracker,
+                                 output_hdr_t *output) {
+  DEBUG3_PRINTLN("Initializing sensor data handler");
+  return true;
+}
+
 boolean process_sensor_data(output_hdr_t *output,
                             void *object,
                             program_tracker_t *tracker) {

    DEBUG_ERR_STATE(1);
  }

  if (outputs_found & (1 << HMTL_OUTPUT_RS485)) {
    /* Setup the RS485 connection */  
    rs485.setup();
    rs485.initBuffer(rs485_data_buffer, SEND_BUFFER_SIZE);
    serial_socket = &rs485;
    sockets[0] = &rs485;
  }

  if (outputs_found & (1 << HMTL_OUTPUT_XBEE)) {
    /* Setup the RS485 connection */  
    xbee.setup();
    xbee.initBuffer(xbee_data_buffer, SEND_BUFFER_SIZE);
    serial_socket = &xbee;
    sockets[1] = &xbee;
  }

  if (serial_socket == NULL) {
    DEBUG_ERR("No sockets configured");
    DEBUG_ERR_STATE(2);
  }

  { HMTL_PROGRAM_NONE, NULL, NULL},
  { HMTL_PROGRAM_BLINK, program_blink, program_blink_init },
  { HMTL_PROGRAM_TIMED_CHANGE, program_timed_change, program_timed_change_init },
  { HMTL_PROGRAM_FADE, program_fade, program_fade_init },

  { HMTL_PROGRAM_LEVEL_VALUE, program_level_value, program_level_value_init },
  { HMTL_PROGRAM_SOUND_VALUE, program_sound_value, program_sound_value_init },
  { PROGRAM_SENSOR_DATA, process_sensor_data, program_sensor_data_init }
};
#define NUM_PROGRAMS (sizeof (program_functions) / sizeof (hmtl_program_t))

