mbed Sensor node for Instrumented Booth over ETH.

Dependencies:   EthernetInterface-1 MaxbotixDriver Presence HTU21D_TEMP_HUMID_SENSOR_SAMPLE Resources SHARPIR mbed-rtos mbed-src WDT_K64F nsdl_lib

Fork of Trenton_Switch_LPC1768_ETH by Demo Team

Files at this revision

API Documentation at this revision

Comitter:
andcor02
Date:
Fri Dec 05 14:31:36 2014 +0000
Parent:
28:908a6f58aa7f
Child:
30:b74aa0729b07
Commit message:
Working on Height intergration

Changed in this revision

MaxbotixDriver.lib Show annotated file Show diff for this revision Revisions of this file
Resources/height.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-src.lib Show annotated file Show diff for this revision Revisions of this file
sensor_ctl.cpp Show annotated file Show diff for this revision Revisions of this file
sensor_ctl.h Show annotated file Show diff for this revision Revisions of this file
--- a/MaxbotixDriver.lib	Fri Dec 05 13:57:36 2014 +0000
+++ b/MaxbotixDriver.lib	Fri Dec 05 14:31:36 2014 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/DanielC/code/MaxbotixDriver/#7e65f5077f5a
+http://developer.mbed.org/users/andcor02/code/MaxbotixDriver/#964f4d42a3d6
--- a/Resources/height.cpp	Fri Dec 05 13:57:36 2014 +0000
+++ b/Resources/height.cpp	Fri Dec 05 14:31:36 2014 +0000
@@ -9,7 +9,7 @@
 #define HEIGHT_RES_RT    "Height"
 
 #if NODE_HEIGHT_STATION
-extern float current_door_height_value;
+extern float current_height_value;
 static char height_val[5];
 static uint8_t max_age = 0; 
 static uint8_t content_type = 50;
@@ -25,7 +25,7 @@
 void height_report() {
     if(obs_number != 0){// && obs_token_ptr != NULL){
         obs_number++;
-        snprintf(height_val,5,"%f" ,current_door_height_value);
+        snprintf(height_val,5,"%f" ,current_height_value);
         if(sn_nsdl_send_observation_notification(obs_token_ptr, obs_token_len, (uint8_t*)height_val, 5, &obs_number, 1, COAP_MSG_TYPE_NON_CONFIRMABLE, 0) == 0) {
             printf("Height Observation Sending Failed\r\n");
         } else {
--- a/main.cpp	Fri Dec 05 13:57:36 2014 +0000
+++ b/main.cpp	Fri Dec 05 14:31:36 2014 +0000
@@ -183,10 +183,10 @@
         }
         #endif //NODE TRIP STATION
         #if NODE_HEIGHT_STATION
- //       if (temperatureReportTimer.read_ms() >= TEMPERATURE_REPORT_PERIOD_MS){
-//            
-//            temperatureReportTimer.reset();
-//        }
+        if (heightTimer.read_ms() >= DOOR_HEIGHT_PERIOD_MS ){
+            
+            heightReportTimer.reset();
+        }
         #endif //NODE HEIGHT STATION
         #endif //NODE_SENSOR_STATION
     }
--- a/mbed-src.lib	Fri Dec 05 13:57:36 2014 +0000
+++ b/mbed-src.lib	Fri Dec 05 14:31:36 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-src/#712edee6295a
+http://mbed.org/users/mbed_official/code/mbed-src/#8eeb5157dee4
--- a/sensor_ctl.cpp	Fri Dec 05 13:57:36 2014 +0000
+++ b/sensor_ctl.cpp	Fri Dec 05 14:31:36 2014 +0000
@@ -141,21 +141,22 @@
 #endif //NODE_DOOR_TRIP_STATION
 
 #if NODE_HEIGHT_STATION
-void drive_height(){
-//    current_height_value=/*obj*/.data_conversion_m();
-//    
-//    if(current_height_value>1) {
-//         if (current_height_value>maxValue){
-//            maxValue = current_height_value;   
-//         }   
-//        set=true;
-//    }
-//    
-//    if(current_height_value<1 && set) {
-//        current_height_value=maxValue;
-//        height_report();
-//        maxValue=0,set=false;
-//    }
+void handle_door_height_sample_timer(){
+    float current_height_value=sonar.data_conversion_m();
+    float maxValue=0;
+    bool set=0;
+    if(current_height_value>1) {
+        if (current_height_value>maxValue) {
+            maxValue = current_height_value;
+            }
+        set=true;
+    }
+
+    if(current_height_value<1 && set) {
+        current_height_value=maxValue;
+        height_report();
+        maxValue=0,set=false;
+    }
 
 }
 
--- a/sensor_ctl.h	Fri Dec 05 13:57:36 2014 +0000
+++ b/sensor_ctl.h	Fri Dec 05 14:31:36 2014 +0000
@@ -36,5 +36,4 @@
 void handle_door_trip_report_timer();
 void handle_kiosk_report_timer();
 
-void drive_height();
 #endif  // SENSOR_CTL_H_
\ No newline at end of file