Aruna
Water.h
Go to the documentation of this file.
1 //
2 // Created by noeel on 16-04-20.
3 //
4 
5 #ifndef ARUNA_WATER_H
6 #define ARUNA_WATER_H
7 
8 #include <aruna/arunaTypes.h>
9 #include "aruna/sis/Performer.h"
10 
11 namespace aruna {
12  namespace sensor {
13 
14 // TODO water_status_t is polluting sensor namespace
15  struct water_status_t : public sis::status_t {
16 // location of sensor
17 // TODO location as parameter in constructor.
18  char location[7] = "NOTDEV";
19 
20  uint8_t water_level_mm = 0;
21 
26  void update_description(uint8_t water_level);
27 
28  void encode(uint8_t *buffer) override;
29 
30  void decode(uint8_t *to_decode) override;
31 
32  uint8_t get_encode_size() override;
33 
38  };
39 
40  class Water : public sis::Performer {
41  private:
43 
44  public:
45 
49  Water();
50 
56  virtual err_t get_water_level(uint16_t &water_level_in_mm) = 0;
57 
63  err_t is_wet(bool &water_detected);
64 
65  sis::status_t *update_status() override;
66 
71  void set_sis_status_location(char* location);
72  };
73 
74  }
75 }
76 
77 
78 #endif //ARUNA_WATER_H
Definition: comm.cpp:14
uint8_t get_encode_size() override
Definition: Water.cpp:64
status_t status
stores the comm status
Definition: comm.cpp:40
void update_description(uint8_t water_level)
updates description with water level.
Definition: Water.cpp:43
void encode(uint8_t *buffer) override
Definition: Water.cpp:47
status that is to be reported to the watcher
Definition: sisTypes.h:36
void decode(uint8_t *to_decode) override
Definition: Water.cpp:56
water_status_t()
water-specific SIS status
Definition: Water.cpp:68