Core Base Classes for the Light Endpoints

Dependencies:   BufferedSerial

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more

Revision:
169:5ba15f5f7f87
Parent:
167:2529c18d0eb1
Child:
170:9e72f2d0f2b2
--- a/Light.cpp	Thu Jul 17 17:08:54 2014 +0000
+++ b/Light.cpp	Thu Jul 17 19:50:57 2014 +0000
@@ -80,7 +80,9 @@
     if (this->m_switch_action != NULL) delete this->m_switch_action;
     if (this->m_pl != NULL) delete this->m_pl;
     if (this->m_ext_led != NULL) delete this->m_ext_led;
+ #ifdef APM_LIGHT_PERSONALITY
     if (this->m_apm_light != NULL) delete this->m_apm_light;
+ #endif
     this->stopBlinkingThread();
  }
  
@@ -96,8 +98,10 @@
  // get the External LED light
  ExternalLEDLight *Light::extled() { return this->m_ext_led; }
  
-  // get the APM light
+ #ifdef APM_LIGHT_PERSONALITY
+ // get the APM light
  APMDemoLight *Light::apmlight() { return this->m_apm_light; }
+ #endif
  
  // set the dimmer action
  void Light::setDimmerAction(void *dimmer_action) { this->m_dimmer_action = dimmer_action; }
@@ -117,7 +121,9 @@
     this->manageBlinkingThread();  
     if (PL_ENABLE && this->pl() != NULL) this->pl()->on(); 
     if (EXT_LED_ENABLE && this->extled() != NULL) this->extled()->on();
+#ifdef APM_LIGHT_PERSONALITY
     if (APM_LIGHT_ENABLE && this->apmlight() != NULL) this->apmlight()->on();
+#endif
  }
  
  // turn OFF 
@@ -126,7 +132,9 @@
     this->manageBlinkingThread(); 
     if (PL_ENABLE && this->pl() != NULL) this->pl()->off(); 
     if (EXT_LED_ENABLE && this->extled() != NULL) this->extled()->off();
+#ifdef APM_LIGHT_PERSONALITY
     if (APM_LIGHT_ENABLE && this->apmlight() != NULL) this->apmlight()->off();
+#endif
  }
  
  // initiate blinking
@@ -236,7 +244,9 @@
  void Light::dim(int value) { 
     if (PL_ENABLE && this->pl() != NULL) this->pl()->dim(value); 
     if (EXT_LED_ENABLE && this->extled() != NULL) this->extled()->dim(value);
+#ifdef APM_LIGHT_PERSONALITY
     if (APM_LIGHT_ENABLE && this->apmlight() != NULL) this->apmlight()->dim(value);
+#endif
  }