Changeset 8 for trunk/Arduino
- Timestamp:
- Jun 28, 2019, 1:42:31 AM (7 years ago)
- Location:
- trunk/Arduino
- Files:
-
- 3 edited
-
libraries/ot_slave_2/ot_slave_2.cpp (modified) (1 diff)
-
libraries/ot_slave_2/ot_slave_2.h (modified) (2 diffs)
-
projects/OT_boiler/OT_boiler.ino (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Arduino/libraries/ot_slave_2/ot_slave_2.cpp
r7 r8 6 6 OpenthermData OT_V2R2_Slave::message; 7 7 8 OT_V2R2_Slave::OT_V2R2_Slave ( )8 OT_V2R2_Slave::OT_V2R2_Slave (OT_Data_CB cb) 9 9 : 10 cbPostReq(cb), 10 11 chEnable(false), 11 12 chActive(false), -
trunk/Arduino/libraries/ot_slave_2/ot_slave_2.h
r7 r8 5 5 #include <opentherm.h> 6 6 7 typedef void (*OT_Data_CB)(const OpenthermData&); 8 7 9 class OT_V2R2_Slave { 8 10 9 11 protected: 10 12 static OpenthermData message; 13 OT_Data_CB cbPostReq; 11 14 bool chEnable; 12 15 bool chActive; … … 18 21 19 22 public: 20 OT_V2R2_Slave ( );23 OT_V2R2_Slave (OT_Data_CB cbPostReq = 0); 21 24 22 25 virtual void Setup (); -
trunk/Arduino/projects/OT_boiler/OT_boiler.ino
r7 r8 2 2 #include <Ethernet.h> 3 3 #include <ot_slave_2.h> 4 5 void Sent_OT_Data (const OpenthermData& data); 4 6 5 7 byte mac[] = { 0x02, 0xDE, 0xAD, 0xDE, 0xAD, 0x01 }; … … 9 11 volatile bool _connected = false; 10 12 11 OT_V2R2_Slave boiler ;13 OT_V2R2_Slave boiler(Sent_OT_Data); 12 14 13 15 EthernetClient client; … … 15 17 void setup() 16 18 { 17 boiler.Setup();18 19 19 // Console 20 20 // Serial.begin(9600); … … 26 26 */ 27 27 Serial.println("\nSystem starting..."); 28 // Setup OT 29 Serial.print("OpenTherm.setup..."); 30 boiler.Setup(); 31 Serial.println("done"); 28 32 // Setup Ethernet 29 33 Serial.print("Ethernet.begin..."); … … 87 91 Serial.println("Ethernet: connection lost!"); 88 92 } 89 Serial.println("Ethernet: restarting...");93 // Serial.println("Ethernet: restarting..."); 90 94 client.stop(); 91 Serial.println("Ethernet: connecting...");95 // Serial.println("Ethernet: connecting..."); 92 96 client.connect(server, 23456); 93 97 } 94 98 } 95 99 96 void Sent_OT_Data ( OpenthermData& data)100 void Sent_OT_Data (const OpenthermData& data) 97 101 { 98 102 state = OPENTHERM::getMode();
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/Paradigma/chrome/site/paradigma.png)