From: Christian Pointner Date: Tue, 22 Nov 2011 21:18:41 +0000 (+0000) Subject: added ajar sensor to messages doc X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=5770ab5e75f7893fbea16358b58d546edfca531b;p=svn42.git added ajar sensor to messages doc ws cleanups added init complete output after reset --- diff --git a/firmware-messages.txt b/firmware-messages.txt index cf16cea..a58c540 100644 --- a/firmware-messages.txt +++ b/firmware-messages.txt @@ -3,6 +3,8 @@ Messages: + after reset: + init complete manual open key pressed: open forced manually @@ -24,14 +26,14 @@ t ... toggle responce: "Ok", "Error: .*" s ... status - response: "Status: closed|opened|<->, opening|waiting|closing|idle" + response: "Status: closed|opened|<->, opening|waiting|closing|idle, ajar|shut" or "Error: .*" r ... reset "Ok, closing now" or "Error: .*" * ... everything else Error: unknown command - open/close will only be accepted if Status: ..., idle + open/close will only be accepted if Status: ..., idle, ... otherwise response: Error: Operation in progress unless error case s will always be accepted diff --git a/firmware/tuer.pde b/firmware/tuer.pde index c4bfcb4..cd4b576 100644 --- a/firmware/tuer.pde +++ b/firmware/tuer.pde @@ -549,6 +549,7 @@ void setup() current_state = CLOSING; start_step_timer(); } + Serial.println("init complete"); } void loop() @@ -564,8 +565,8 @@ void loop() } else if (command == CMD_OPEN) { if(current_state == IDLE) { - if(is_opened()) - Serial.println("Already open"); + if(is_opened()) + Serial.println("Already open"); else { start_open(); Serial.println("Ok"); @@ -576,8 +577,8 @@ void loop() } else if (command == CMD_CLOSE) { if(current_state == IDLE) { - if(is_closed()) - Serial.println("Already closed"); + if(is_closed()) + Serial.println("Already closed"); else { start_close(); Serial.println("Ok"); @@ -588,11 +589,11 @@ void loop() } else if (command == CMD_TOGGLE) { if(current_state == IDLE) { - if(is_closed()) - start_open(); - else - start_close(); - Serial.println("Ok"); + if(is_closed()) + start_open(); + else + start_close(); + Serial.println("Ok"); } else Serial.println("Error: Operation in progress");