Changeset 8 for trunk/Arduino


Ignore:
Timestamp:
Jun 28, 2019, 1:42:31 AM (7 years ago)
Author:
markus
Message:

Prototype for network based monitoring

Location:
trunk/Arduino
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Arduino/libraries/ot_slave_2/ot_slave_2.cpp

    r7 r8  
    66OpenthermData  OT_V2R2_Slave::message;
    77
    8 OT_V2R2_Slave::OT_V2R2_Slave ()
     8OT_V2R2_Slave::OT_V2R2_Slave (OT_Data_CB cb)
    99:
     10  cbPostReq(cb),
    1011  chEnable(false),
    1112  chActive(false),
  • trunk/Arduino/libraries/ot_slave_2/ot_slave_2.h

    r7 r8  
    55#include <opentherm.h>
    66
     7typedef void (*OT_Data_CB)(const OpenthermData&);
     8
    79class OT_V2R2_Slave {
    810
    911protected:
    1012  static OpenthermData  message;
     13  OT_Data_CB            cbPostReq;
    1114  bool                  chEnable;
    1215  bool                  chActive;
    … …  
    1821
    1922public:
    20   OT_V2R2_Slave ();
     23  OT_V2R2_Slave (OT_Data_CB cbPostReq = 0);
    2124
    2225  virtual void  Setup ();
  • trunk/Arduino/projects/OT_boiler/OT_boiler.ino

    r7 r8  
    22#include <Ethernet.h>
    33#include <ot_slave_2.h>
     4
     5void  Sent_OT_Data (const OpenthermData& data);
    46
    57byte  mac[] = { 0x02, 0xDE, 0xAD, 0xDE, 0xAD, 0x01 };
    … …  
    911volatile bool  _connected = false;
    1012
    11 OT_V2R2_Slave boiler;
     13OT_V2R2_Slave boiler(Sent_OT_Data);
    1214
    1315EthernetClient client;
    … …  
    1517void setup()
    1618{
    17   boiler.Setup();
    18 
    1919  // Console
    2020  // Serial.begin(9600);
    … …  
    2626*/
    2727  Serial.println("\nSystem starting...");
     28  // Setup OT
     29  Serial.print("OpenTherm.setup...");
     30  boiler.Setup();
     31  Serial.println("done");
    2832  // Setup Ethernet
    2933  Serial.print("Ethernet.begin...");
    … …  
    8791      Serial.println("Ethernet: connection lost!"); 
    8892    }
    89     Serial.println("Ethernet: restarting...");
     93//    Serial.println("Ethernet: restarting...");
    9094    client.stop();
    91     Serial.println("Ethernet: connecting...");
     95//    Serial.println("Ethernet: connecting...");
    9296    client.connect(server, 23456); 
    9397  }
    9498}
    9599
    96 void    Sent_OT_Data (OpenthermData& data)
     100void    Sent_OT_Data (const OpenthermData& data)
    97101{
    98102  state = OPENTHERM::getMode();
Note: See TracChangeset for help on using the changeset viewer.