NewAskSin
 All Classes Files Functions Variables Groups Pages
Registrar.h
1 //- -----------------------------------------------------------------------------------------------------------------------
2 // AskSin driver implementation
3 // 2013-08-03 <trilu@gmx.de> Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
4 //- -----------------------------------------------------------------------------------------------------------------------
5 //- AskSin registrar functions --------------------------------------------------------------------------------------------
6 //- with a lot of support from martin876 at FHEM forum
7 //- -----------------------------------------------------------------------------------------------------------------------
8 
9 
10 #ifndef _RG_H
11 #define _RG_H
12 
13 #include "HAL.h"
14 #include "Fastdelegate.h"
15 
16 //- typedef for delegate to module function
17 using namespace fastdelegate;
18 typedef FastDelegate5<uint8_t, uint8_t, uint8_t, uint8_t*, uint8_t> s_mod_dlgt; // void hmEventCol(uint8_t by3, uint8_t by10, uint8_t by11, uint8_t *data, uint8_t len)
19 
20 class RG {
21  friend class AS;
22 
23  public: //---------------------------------------------------------------------------------------------------------
24  struct s_modTable {
25  uint8_t cnl; // channel where the module is registered to
26  uint8_t lst; // module has a list3 or list 4
27  uint8_t msgCnt; // channel message counter
28  uint8_t *lstCnl; // pointer to list0/1
29  uint8_t *lstPeer; // pointer to list3/4
30  s_mod_dlgt mDlgt; // delegate to the module function
31  };
32 
33  protected: //---------------------------------------------------------------------------------------------------------
34 
35  private: //---------------------------------------------------------------------------------------------------------
36  class AS *pHM; // pointer to main class for function calls
37 
38  public: //---------------------------------------------------------------------------------------------------------
39  void regInAS(uint8_t cnl, uint8_t lst, s_mod_dlgt delegate, uint8_t *mainList, uint8_t *peerList);
40 
41  protected: //---------------------------------------------------------------------------------------------------------
42  private: //---------------------------------------------------------------------------------------------------------
43  RG();
44  void init(AS *ptrMain);
45  void poll(void);
46 
47 };
48 extern RG::s_modTable modTbl[]; // initial register.h
49 
50 #endif
Main class for implementation of the AskSin protocol stack. Every device needs exactly one instance o...
Definition: AS.h:39
void init(void)
Initialize the AS module.
Definition: AS.cpp:20
Definition: Registrar.h:20
Definition: Registrar.h:24
void poll(void)
Poll routine for regular operation.
Definition: AS.cpp:44