source: trunk/Arduino/libraries/OT_Slave/OT_Slave.h @ 26

Last change on this file since 26 was 17, checked in by markus, 7 years ago

Fake active detection and buildin LED support

File size: 1.5 KB
RevLine 
[11]1#ifndef _OT_SLAVE_H
2#define _OT_SLAVE_H
3
4#include "Arduino.h"
5#include <opentherm.h>
6
7struct OT_Action {
8
9  OpenthermData request;
10  OpenthermData response;
[12]11
12  uint32_t      GetRequestValue () const { return OTD2uint32(request); }
13  uint32_t      GetResponseValue () const { return OTD2uint32(response); }
14
15  static uint32_t       OTD2uint32 (const OpenthermData&);
[11]16};
17
18typedef void (*OT_Action_CB)(const OT_Action&);
19
20class OT_Slave {
21
22protected:
23  static OT_Action     action;
24  OT_Action_CB  cbAction;
25  bool          chEnable;   // ch : Central Heating
26  bool          chActive;
27  float         chTemperature;
28  bool          dhwEnable;  // dhw  : Domain Hot Water
29  bool          dhwActive;
30  float         dhwTemperature;
31
[17]32  float         tBoiler;        // max(ch,dhw,return)
33  float         tReturn;        // Troom (28.0)
[15]34
[11]35public:
36                OT_Slave ();
37
38  virtual void  begin (OT_Action_CB cbAction = 0);
39  virtual void  maintain ();
40 
41  virtual void  HandleRequest (OT_Action& action);
42  virtual void  ConfigReq (OT_Action& action);
43  virtual void  StatusReq (OT_Action& action);
44  virtual void  FaultReq (OT_Action& action);
45
46  virtual bool  CH_Enable (bool enable = true);
47  virtual bool  CH_Disable ();
48  virtual void  CH_Temperature (float);
49  virtual bool  DHW_Enable (bool enable = true);
50  virtual bool  DHW_Disable ();
51  virtual void  DHW_Temperature (float);
52
[17]53  virtual bool  IsActive ();
54
[15]55  virtual float GetBoilerTemperature ();
56  virtual float GetReturnTemperature ();
57
[11]58private:
59  static void   ListenAfterResponse ();
60
61};
62
63#endif  // _OT_SLAVE_H
Note: See TracBrowser for help on using the repository browser.