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

Prototype for network based monitoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.