Skip to content

Commit

Permalink
[#14] Added Relay::stringState to print on the web page
Browse files Browse the repository at this point in the history
Signed-off-by: Clovis Durand <[email protected]>
  • Loading branch information
Clovel committed Dec 12, 2019
1 parent 77d54dc commit 3830d86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions software/inc/Relay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Includes -------------------------------------------- */
#include "elec.hpp"
#include <string>

/* Defines --------------------------------------------- */

Expand All @@ -28,6 +29,7 @@ namespace elec {
/* Getters */
bool isOn(void) const;
relayMode_t mode(void) const;
std::string stringState(void) const;

/* Setters */
void setMode(const relayMode_t &pMode);
Expand Down
4 changes: 4 additions & 0 deletions software/src/Relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ namespace elec {
return mMode;
}

std::string Relay::stringState(void) const {
return 0 == mState ? "OFF" : "ON";
}

/* Setters */
void Relay::setMode(const relayMode_t &pMode) {
mMode = pMode;
Expand Down

0 comments on commit 3830d86

Please sign in to comment.