Diff: VBus.h
- Revision:
- 4:c16866ed9508
- Parent:
- 3:5ae3c983f241
--- a/VBus.h Sun Apr 17 17:25:56 2011 +0000
+++ b/VBus.h Wed May 04 20:15:25 2011 +0000
@@ -1,5 +1,10 @@
/*
- Copyright (c) 2010 Wim De Roeve
+ Copyright (c) 2010 Wimpie
+
+ Based on the VBus® Protocol Specification see http://goo.gl/HP6ZY
+ and http://hobbyelektronik.org/w/index.php/VBus-Decoder
+
+ VBus® en Resol® are registrated trademarks see http://www.resol.de
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -27,7 +32,7 @@
#define FLength 6 // Framelength
#define FOffset 10 // Offset start of Frames
#define FSeptet 4 // Septet byte in Frame
-#define ResolAddress 0x3271 // Address of the controller
+#define ResolAddress 0x3271 // ConergyDT5 (0x3271) Address of the controller
#define SENSORNOTCONNECTED 8888
#include "mbed.h"
@@ -35,7 +40,6 @@
/** @defgroup API The VBus API */
/** VBus module
- * @author Wim De Roeve
*
* Example:
* @code
@@ -43,7 +47,7 @@
* #include "VBus.h"
*
* Serial pc(USBTX, USBRX);
- * VBus ResolBS(p9, p10);
+ * VBus ResolBS(NC, p10);
*
* int main() {
*
@@ -66,13 +70,35 @@
/**
* The VBus constructor is used to initialise the VBus object.
*
- * @param tx The TX pin the VBus is connected to p9, p13, p28
- * @param rx The RX pin the GPS is connected to p10, p14, p27.
+ * @param tx The TX pin is NOT connected
+ * @param rx The RX pin is connected to p10 or p14 or p27.
*/
VBus(PinName tx, PinName rx);
+ /**
+ * The VBus destructor
+ */
+ // virtual ~VBus();
- uint16_t networkaddress;
+
+ /**
+ * Read
+ * Reads all the device parameters (Sensors, Pumpspeed, RelaisMask)
+ **/
+ bool Read();
+ /**
+ * SaveToSDcard
+ * Saves the device parameters to a textfile /sd/vb20110101.txt
+ **/
+ void SaveToSDcard(char* datetime, char* date,char* dayfn);
+ void SDcardAvailable(bool status);
+ /**
+ * ClearMax
+ * Clears the maximum values
+ **/
+ void ClearMax();
+
+ uint16_t networkaddress;
float Sensor1_temp;
float Sensor2_temp;
float Sensor3_temp;
@@ -88,19 +114,15 @@
char RelaisMask;
char ErrorMask;
uint16_t SystemTime;
- char System;
+ char Scheme;
char OptionPostPulse;
char OptionThermostat;
- char OptionWMZ;
+ char OptionHQM;
uint16_t OperatingHoursRelais1;
uint16_t OperatingHoursRelais2;
+ uint32_t HeatQuantity;
+ uint16_t Version;
uint16_t OperatingHoursRelais1Today;
-
- void Init(int addr);
- bool Read();
- void SaveToSDcard(char* datetime, char* date,char* dayfn);
- void SDcardAvailable(bool status);
- void ClearMax();
protected:
Serial _Serial;
@@ -124,6 +146,7 @@
bool _sdcard;
bool _all;
+ void Init(int addr);
void InjectSeptet(unsigned char *Buffer, int Offset, int Length);
void FrameOutput (void);
void make_Header (unsigned int DAdr,unsigned int SAdr,unsigned char Ver,unsigned int Cmd,unsigned char AFrames);