From: Bernhard Tittelbach Date: Sun, 14 Mar 2010 18:39:59 +0000 (+0000) Subject: New Sensor Events X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=1931337bc1b3812d25c0ff95cd02ea19b9239324;p=svn42.git New Sensor Events --- diff --git a/powersensordaemon/COMMANDS.txt b/powersensordaemon/COMMANDS.txt index 5419633..a0837f5 100644 --- a/powersensordaemon/COMMANDS.txt +++ b/powersensordaemon/COMMANDS.txt @@ -3,8 +3,8 @@ COMMAND:= power (on|off) $POWERID | listen $EVENT | sample $SAMPLEDEV | log POWERID:= werkzeug | stereo | labor | schreibtisch | logo | idee -EVENT:= all | request | temp | photo | movement | button | none -SAMPLEDEV:=temp[0-9]+ | photo[0-9]+ +EVENT:= all | request | sensor | movement | button | none +SAMPLEDEV:=temp[0-9]+ | photo[0-9]+ | [0-9]+ Notes: * subscription to events is cummulativ @@ -18,4 +18,4 @@ ERRORSTR:=no connection | unknown device | .... == Listener Data from Daemon == (Temperature Data in Degrees Celsius) -LISTENERDATA:=temp[0-9]+: [0-9]{1,3}\.[0-9]{2} | photo[0-9]+: [0-9]{1,3} | movement | button[0-9] +LISTENERDATA:=temp[0-9]+: [0-9]{1,3}\.[0-9]{2} | photo[0-9]+: [0-9]{1,3} | [0-9]+: | movement | button[0-9] diff --git a/rf433ctl/rf433ctl.pde b/rf433ctl/rf433ctl.pde index 2cf589a..c37778c 100644 --- a/rf433ctl/rf433ctl.pde +++ b/rf433ctl/rf433ctl.pde @@ -308,8 +308,9 @@ boolean pb_state=0; boolean pb_postth_state=0; unsigned int pb_time=0; -void echoCommand(char command) +void sensorEchoCommand(char command) { + Serial.print("Sensor "); Serial.print(command); Serial.print(": "); } @@ -394,12 +395,12 @@ void loop() send_frame(words[D2_OFF]); else if(command == 'T') { - echoCommand(command); + sensorEchoCommand(command); printTemperature(onShieldTemp); } else if(command == 'P') { - echoCommand(command); + sensorEchoCommand(command); printLightLevel(); } else