From bc151bec00aa1a23acb528c7ed162680677da761 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sat, 27 Mar 2010 08:28:02 +0000 Subject: [PATCH] Elliminate superflous messages --- openwrt-packages/usocket/Makefile | 2 +- rf433ctl/rf433ctl.pde | 4 ++-- serial_console/sample_sensors.c | 24 ++++++++++++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/openwrt-packages/usocket/Makefile b/openwrt-packages/usocket/Makefile index 4bcec8a..5b927cd 100644 --- a/openwrt-packages/usocket/Makefile +++ b/openwrt-packages/usocket/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=usocket -PKG_VERSION:=0.4 +PKG_VERSION:=0.5 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/usocket diff --git a/rf433ctl/rf433ctl.pde b/rf433ctl/rf433ctl.pde index 3501cb3..f283c5f 100644 --- a/rf433ctl/rf433ctl.pde +++ b/rf433ctl/rf433ctl.pde @@ -205,7 +205,7 @@ void printTemperature(DeviceAddress deviceAddress) { dallas_sensors.requestTemperatures(); float tempC = dallas_sensors.getTempC(deviceAddress); - Serial.print("Temp C: "); + //Serial.print("Temp C: "); Serial.println(tempC TEMPC_OFFSET_ARDUINO_GENEREATED_HEAT); //Serial.print(" Temp F: "); //Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit @@ -236,7 +236,7 @@ void updateLightLevel(unsigned int pin) void printLightLevel() { - Serial.print("Photo: "); + //Serial.print("Photo: "); Serial.println(light_level_mean_); } diff --git a/serial_console/sample_sensors.c b/serial_console/sample_sensors.c index 923f274..7bfc7da 100644 --- a/serial_console/sample_sensors.c +++ b/serial_console/sample_sensors.c @@ -5,8 +5,7 @@ unsigned int collect_data(char *buffer, unsigned int size) char *cmd; if (size >= 8 && strncmp("movement", buffer, 8) == 0) return 1; - - if (size > 16 && strncmp("temp0:", buffer, 5) == 0) + else if (size > 15 && strncmp("temp0: Temp C:", buffer, 14) == 0) { if (asprintf(&cmd, "rrdtool update %s -t temp N:%s", rrd_temp_, buffer + 15)) { @@ -15,8 +14,16 @@ unsigned int collect_data(char *buffer, unsigned int size) free(cmd); } } - - if (size > 16 && strncmp("photo0:", buffer, 6) == 0) + else if (size > 7 && strncmp("temp0:", buffer, 6) == 0) + { + if (asprintf(&cmd, "rrdtool update %s -t temp N:%s", rrd_temp_, buffer + 7)) + { + /*printf("%s\n",cmd);*/ + system(cmd); + free(cmd); + } + } + else if (size > 15 && strncmp("photo0: Photo:", buffer, 14) == 0) { if (asprintf(&cmd, "rrdtool update %s -t light N:%s", rrd_light_, buffer + 15)) { @@ -25,6 +32,15 @@ unsigned int collect_data(char *buffer, unsigned int size) free(cmd); } } + else if (size > 8 && strncmp("photo0:", buffer, 7) == 0) + { + if (asprintf(&cmd, "rrdtool update %s -t light N:%s", rrd_light_, buffer + 7)) + { + /*printf("%s\n",cmd);*/ + system(cmd); + free(cmd); + } + } return 0; } -- 1.7.10.4