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:
134:58e7537a8c5f
Parent:
133:667409048c68
Child:
136:f433e40f8d65
--- a/CommonDefinitions.h	Thu Mar 27 02:58:30 2014 +0000
+++ b/CommonDefinitions.h	Fri Mar 28 16:24:12 2014 +0000
@@ -20,52 +20,54 @@
 #define _COMMON_DEFINITIONS_H_
 
 // Error Handler Log Message Length
-#define MAX_LOG_MESSAGE             900           // maximum size of a logging message
-#define TEMP_BUFFER_LEN             128           // working/temp buffer length
+#define MAX_LOG_MESSAGE             900                             // maximum size of a logging message
+#define TEMP_BUFFER_LEN             128                             // working/temp buffer length
 
 // Resource Configuration
-#define RESOURCE_NAME_LEN           25            // Resource name max length
-#define RESOURCE_VALUE_LEN          33            // Resource value max length
+#define RESOURCE_NAME_LEN           25                              // Resource name max length
+#define RESOURCE_VALUE_LEN          33                              // Resource value max length
 
 // Number of Resources our Endpoint has
-#define NUM_RESOURCES               50            // do not exceed this number of resources in the endpoint. currently at 25
+#define NUM_RESOURCES               50                              // do not exceed this number of resources in the endpoint. currently at 25
 
 // IOC <--> Resource Mapping
-#define NUM_MAPPINGS                50            // do not exceed this number of IOC <--> NSP resource mappings. currently at 17
+#define NUM_MAPPINGS                50                              // do not exceed this number of IOC <--> NSP resource mappings. currently at 17
 
 // MapEntry Name length
 #define MAX_NAME_LENGTH             25
 
 // Preferences configuration
-#define MAX_NUM_PREFERENCES         10                    // support a total of 10 unique preferences
-#define PREFERENCE_NAME_LEN         32                    // largest preference name
-#define PREFERENCE_VALUE_LEN        48                    // largest preference value
+#define MAX_NUM_PREFERENCES         10                              // support a total of 10 unique preferences
+#define PREFERENCE_NAME_LEN         32                              // largest preference name
+#define PREFERENCE_VALUE_LEN        48                              // largest preference value
+
+// Personality Configuration
+#define NUM_PERSONALITY_INSTANCES   1                               // number of isntances of a specific personality (i.e. light) in this endpoint
+#define PERSONALITY_NAME_LEN        48                              // buffer size for the personality name
+#define PERSONALITY_NAME_INDEX      1                               // start index for the ID of the personality name
 
 // Common Light Definition
-#define NUM_LIGHTS                  1              // number of lights in this endpoint
-#define LIGHT_NAME_LEN              48             // buffer size for the light name
-#define LIGHT_ON_STATE              "0"            // initial state of each light in this endpoint
-#define LIGHT_DIM_STATE             "25"           // initial dimming state of each light in this endpoint
+#define LIGHT_ON_STATE              "0"                             // initial state of each light in this endpoint
+#define LIGHT_DIM_STATE             "25"                            // initial dimming state of each light in this endpoint
+#define LIGHT_DEFAULT_STATE         1                               // ON by default
+#define LIGHT_TYPE_STRING           "Light"                         // Type of Light (string)
+#define LIGHT_BLINK_WAIT_MS         1000                            // time between blinks (ms)
 
 // Main Loop
-#define MAIN_LOOP_SLEEP             250            // sleep time (ms) between main loop iterations
+#define MAIN_LOOP_SLEEP             250                             // sleep time (ms) between main loop iterations
 
 // LED Blink Time
-#define BLINK_TIME                  100            // LED blink times
+#define BLINK_TIME                  100                             // LED blink times
 
-// Default Light State
-#define LIGHT_DEFAULT_STATE         1              // ON by default
-
-// IOC Linkage Resource
-#define IOC_LINKAGE_RESOURCE        "/dev/addldata"                 // resource containing IOC linkage ID
-#define IOC_LINKAGE_UNSET           "id:0"                          // IOC linkage not set
+// External Linkage Resource
+#define EXTERNAL_LINKAGE_RESOURCE   "/dev/addldata"                 // resource containing IOC linkage ID
+#define EXTERNAL_LINKAGE_UNSET      "id:0"                          // IOC linkage not set
 
 // Philips Light Support
 #define PL_LIGHT_ID_DOUG            1                               // Dougs Light
 #define PL_LIGHT_ID_BILL            2                               // Bills Light
 #define PL_LIGHT_ID_KERRY           3                               // Kerrys Light
-//#define PL_GW_ADDRESS               "192.168.1.178"                 // Philips Gateway in IOT lab (Austin)
-#define PL_GW_ADDRESS               "10.1.0.82"                     // Philips Gateway in IOT lab (Home)
+#define PL_GW_ADDRESS               "192.168.1.178"                 // Philips Gateway in IOT lab (Austin)
 #define PL_DEFAULT_STATE            LIGHT_DEFAULT_STATE             // on
 #define PL_DEFAULT_DIM              11                              // dim value
 #define PL_URL_BUFFER_LEN           128