-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCalduino.cpp
More file actions
2663 lines (2233 loc) · 97.2 KB
/
Calduino.cpp
File metadata and controls
2663 lines (2233 loc) · 97.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2018 Daniel Macías Perea (dani.macias.perea@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Legal Notices
* 'Bosch Group', 'Buderus', 'Nefit' and 'Worcester' are brands of Bosch Thermotechnology.
* All other trademarks are the property of their respective owners.
*/
/**
* @mainpage EMS Bus - Arduino library.
*
* This library provides functions to communicate through the EMS Bus with Buderus/Nefit/Worcester
* (or any other EMS Bus compatible) boilers. It includes commands for both getting status information
* (UBA Monitor, DHW Monitor, etc.) and setting new configurations (Set Day/Night Temperature,
* Set Working Mode, etc.).
*
* @author dani.macias.perea@gmail.com
*/
/**
* @file Calduino.cpp
*
* @brief The Calduino class declaration including EMSSerial, CalduinoDebug, CalduinoSerial, Calduino Datagrams and Calduino Data Types.
*
*/
#include "wiring_private.h"
#include "Calduino.h"
/* EMS max/min values and constants */
#define MAX_HC_CIRCUIT 2
#define MAX_WORKING_MODE 2
#define MAX_SETBACK_MODE 3
#define MAX_PROGRAM 10
#define MAX_DHW_TEMPERATURE 80
#define MIN_DHW_TEMPERATURE 40
#define MAX_TEMPERATURE 29
#define MIN_TEMPERATURE 6
#define MAX_ROOM_TEMPERATURE_OFFSET 5
#define MIN_ROOM_TEMPERATURE_OFFSET -5
#define MAX_SUMMER_WINTER_THRESHOLD 30
#define MIN_SUMMER_WINTER_THRESHOLD 10
#define MAX_OUT_NIGHT_THRESHOLD 10
#define MIN_OUT_NIGHT_THRESHOLD -20
#define DHW_ONETIME_ON 39
#define DHW_ONETIME_OFF 7
#define SWITCHING_POINTS 42
#define MAX_DAY 31
#define MAX_DAY_WEEK 7
#define MAX_MONTH 12
#define MAX_HOUR_DAY 24
#define MAX_MINUTE_HOUR 60
/* EMS Bus Serial Parameters */
#define INITIAL_OFFSET 4
#define OUT_EMS_BUFFER_SIZE 7
#define TEXT_BUFFER_SIZE 40
#define EMS_DATAGRAM_OVERHEAD 6
#define EMS_MAX_WAIT_TIME 1000
#define RETRY_FACTOR 4
/* Message size*/
#define RC_DATETIME_VALUES_COUNT 6
#define RC_DATETIME_MESSAGE_SIZE 8
#define UBA_WORKING_TIME_VALUES_COUNT 1
#define UBA_WORKING_TIME_MESSAGE_SIZE 3
#define UBA_MONITOR_FAST_VALUES_COUNT 16
#define UBA_MONITOR_FAST_MESSAGE_SIZE 27
#define UBA_MONITOR_SLOW_VALUES_COUNT 6
#define UBA_MONITOR_SLOW_MESSAGE_SIZE 25
#define UBA_PARAMETER_DHW_VALUES_COUNT 2
#define UBA_PARAMETER_DHW_MESSAGE_SIZE 11
#define FLAGS_DHW_VALUES_COUNT 1
#define FLAGS_DHW_MESSAGE_SIZE 1
#define UBA_MONITOR_DHW_VALUES_COUNT 7
#define UBA_MONITOR_DHW_MESSAGE_SIZE 16
#define WORKING_MODE_DHW_VALUES_COUNT 7
#define WORKING_MODE_DHW_MESSAGE_SIZE 10
#define WORKING_MODE_HC_VALUES_COUNT 9
#define WORKING_MODE_HC_MESSAGE_SIZE 42
#define MONITOR_HC_VALUES_COUNT 5
#define MONITOR_HC_MESSAGE_SIZE 16
#define MONITOR_MM_10_VALUES_COUNT 3
#define MONITOR_MM_10_MESSAGE_SIZE 8
#define SWITCHING_PROGRAM_1_VALUES_COUNT 57
#define SWITCHING_PROGRAM_1_MESSAGE_SIZE 99
#define SWITCHING_PROGRAM_2_VALUES_COUNT 42
#define SWITCHING_PROGRAM_2_MESSAGE_SIZE 84
/** EMSSerial definition */
#pragma region EMSSERIAL
// on ATmega8, the uart and its bits are not numbered, so there is no "TXC0"
// definition.
#if !defined(TXC0)
#if defined(TXC)
#define TXC0 TXC
#elif defined(TXC1)
// Some devices have uart1 but no uart0
#define TXC0 TXC1
#else
#error TXC0 not definable in Calduino.h
#endif
#endif
/**
* Stores a character in the EMS Serial Buffer.
* This operation is called when a serial event is triggered
*
* @author Administrator
* @date 5/2/2018
*
* @param c Byte received.
* @param fe Wether the bit error is activated or not.
* @param [in,out] s The EMS Serial stream.
*/
inline void store_char(unsigned char c, bool fe, EMSSerial *s)
{
int i = (unsigned int)(s->_rx_buffer_head + 1) % SERIAL_BUFFER_SIZE;
// if we should be storing the received character into the location
// just before the tail (meaning that the head would advance to the
// current location of the tail), we're about to overflow the buffer
// and so we don't write the character or advance the head.
if (i != s->_rx_buffer_tail) {
s->_rx_buffer[s->_rx_buffer_head] = c;
s->_error_flag[s->_rx_buffer_head] = fe;
s->_rx_buffer_head = i;
}
}
#if !defined(USART0_RX_vect) && defined(USART1_RX_vect)
// do nothing - on the 32u4 the first USART is USART1
#else
#if !defined(USART_RX_vect) && !defined(USART0_RX_vect) && \
!defined(USART_RXC_vect)
#error "Don't know what the Data Received vector is called for the first UART"
#else
/** Ems serial event 0 */
void EMSSerialEvent0() __attribute__((weak));
/** Ems serial event 0 */
void EMSSerialEvent0() {}
#define EMSSerialEvent0_implemented
#if defined(USART_RX_vect)
ISR(USART_RX_vect)
#elif defined(USART0_RX_vect)
ISR(USART0_RX_vect)
#elif defined(USART_RXC_vect)
ISR(USART_RXC_vect) // ATmega8
#endif
{
#if defined(UDR0)
bool fe = bitRead(UCSR0A, FE0);
unsigned char c = UDR0;
store_char(c, fe, &EMSSerial0);
#elif defined(UDR)
bool fe = bitRead(UCSRA, FE);
unsigned char c = UDR;
store_char(c, fe, &EMSSerial0);
#else
#error UDR not defined
#endif
}
#endif
#endif
#if defined(USART1_RX_vect)
void EMSSerialEvent1() __attribute__((weak));
void EMSSerialEvent1() {}
#define EMSSerialEvent1_implemented
ISR(USART1_RX_vect)
{
bool fe = bitRead(UCSR1A, FE1);
unsigned char c = UDR1;
store_char(c, fe, &EMSSerial1);
}
#endif
#if defined(USART2_RX_vect) && defined(UDR2)
void EMSSerialEvent2() __attribute__((weak));
void EMSSerialEvent2() {}
#define EMSSerialEvent2_implemented
ISR(USART2_RX_vect)
{
bool fe = bitRead(UCSR2A, FE2);
unsigned char c = UDR2;
store_char(c, fe, &EMSSerial2);
}
#endif
#if defined(USART3_RX_vect) && defined(UDR3)
void EMSSerialEvent3() __attribute__((weak));
void EMSSerialEvent3() {}
#define EMSSerialEvent3_implemented
ISR(USART3_RX_vect)
{
bool fe = bitRead(UCSR3A, FE3);
unsigned char c = UDR3;
store_char(c, fe, &EMSSerial3);
}
#endif
/**
* EMS Serial event run
*
* @author Administrator
* @date 5/2/2018
*/
void EMSSerialEventRun(void)
{
#ifdef EMSSerialEvent0_implemented
if (EMSSerial0.available()) EMSSerialEvent0();
#endif
#ifdef EMSSerialEvent1_implemented
if (EMSSerial1.available()) EMSSerialEvent1();
#endif
#ifdef EMSSerialEvent2_implemented
if (EMSSerial2.available()) EMSSerialEvent2();
#endif
#ifdef EMSSerialEvent3_implemented
if (EMSSerial3.available()) EMSSerialEvent3();
#endif
}
/**
* EMS Serial Constructor
*
* @param [in] ubrrh USART Baud Rate Register.
* @param [in] ubrrl UBRRL contains the eight least significant bits of the USART baud rate.
* @param [in] ucsra USART Control and Status Register A.
* @param [in] ucsrb USART Control and Status Register B.
* @param [in] ucsrc USART Control and Status Register C.
* @param [in] udr The transmit buffer.
* @param rxen Receiver Enable.
* @param txen Transmitter Enable.
* @param rxcie RX Complete Interrupt Enable.
*/
EMSSerial::EMSSerial(
volatile uint8_t *ubrrh, volatile uint8_t *ubrrl,
volatile uint8_t *ucsra, volatile uint8_t *ucsrb,
volatile uint8_t *ucsrc, volatile uint8_t *udr,
uint8_t rxen, uint8_t txen, uint8_t rxcie)
{
_rx_buffer_head = _rx_buffer_tail = 0;
_error = false;
_ubrrh = ubrrh;
_ubrrl = ubrrl;
_ucsra = ucsra;
_ucsrb = ucsrb;
_ucsrc = ucsrc;
_udr = udr;
_rxen = rxen;
_txen = txen;
_rxcie = rxcie;
}
/** Default constructor */
EMSSerial::EMSSerial() {}
/**
* Start the communication with the EMS Bus UART Interface Circuit
*
* @param baud - baud rate of the UART port.
*
* @return True if it succeeds, false if it fails.
*/
bool EMSSerial::begin(unsigned long baud)
{
uint16_t baud_setting;
*_ucsra = 0;
_written = false;
baud_setting = (F_CPU / 8 / baud - 1) / 2;
// assign the baud_setting, ubbr (USART Baud Rate Register) and UBRRL (eight least significant
// bits of the USART baud rate).
*_ubrrh = baud_setting >> 8;
*_ubrrl = baud_setting;
// set the bits in ucsrb port enabling reception, transmission and complete interrupt.
sbi(*_ucsrb, _rxen);
sbi(*_ucsrb, _txen);
sbi(*_ucsrb, _rxcie);
}
/** Ends the EMS Serial communication */
void EMSSerial::end()
{
// clear the bits in ucsrb port disabling reception, transmission and complete interrupt.
cbi(*_ucsrb, _rxen);
cbi(*_ucsrb, _txen);
cbi(*_ucsrb, _rxcie);
// clear any received data
_rx_buffer_head = _rx_buffer_tail;
}
/**
* Gets the bytes pending to be read
*
* @return Available bytes in the EMS Serial Buffer.
*/
int EMSSerial::available(void)
{
return (unsigned int)(SERIAL_BUFFER_SIZE + _rx_buffer_head - _rx_buffer_tail) % SERIAL_BUFFER_SIZE;
}
/**
* Returns the top-of-stack object without removing it, or -1 otherwise.
*
* @return The current top-of-stack object. If there is no object, return -1.
*/
int EMSSerial::peek(void)
{
if (_rx_buffer_head == _rx_buffer_tail) {
return -1;
}
else {
return _rx_buffer[_rx_buffer_tail];
}
}
/**
* Returns the top-of-stack object removing it.
*
* @return The current top-of-stack object, if any. Return -1 otherwise.
*/
int EMSSerial::read(void)
{
// if the head isn't ahead of the tail, we don't have any characters
if (_rx_buffer_head == _rx_buffer_tail) {
return -1;
}
else {
unsigned char c = _rx_buffer[_rx_buffer_tail];
_error = _error_flag[_rx_buffer_tail];
_rx_buffer_tail = (unsigned int)(_rx_buffer_tail + 1) % SERIAL_BUFFER_SIZE;
return c;
}
}
/** Flushes the EMS Serial by clearing the buffer contents */
void EMSSerial::flush()
{
// clear read buffer
_rx_buffer_head = _rx_buffer_tail;
_error = false;
// disable and enable reception in order to flush the receive buffer
cbi(*_ucsrb, _rxen);
sbi(*_ucsrb, _rxen);
}
/**
* Writes the given character in the EMS Serial
*
* @param c The char to write.
*
* @return The number of bytes written.
*/
size_t EMSSerial::write(uint8_t c)
{
_written = true;
// UDRE Flag indicates if the transmit buffer (UDR) is ready to receive new data. If UDRE is
// one, the buffer is empty, and therefore ready to be written. Wait therefore until buffer
// empty signal.
while (!(bitRead(*_ucsra, UDRE0))) {}
// write value in the trasmit buffer
*_udr = c;
return 1;
}
/**
* Write a EMS end-of-frame character to the port First halt temporarily reception, change
* parity to even and then send a break-character. Then restore the settings and re-enable
* reception
*/
void EMSSerial::writeEOF() {
uint8_t t;
cbi(*_ucsrb, _rxen); //disable reception
while (!(bitRead(*_ucsra, UDRE0))) {} // wait for data register empty
t = *_ucsrc; // save settings
sbi(*_ucsrc, UPM01); //set parity even
sbi(*_ucsra, TXC0); //reset TX-complete (seems to be needed to get parity change)
*_udr = 0; //directly write a break
while (!(bitRead(*_ucsra, TXC0))) {} //wait for transmit complete
*_ucsrc = t; //restore settings
sbi(*_ucsra, TXC0); //reset TX-complete (seems to be needed to get parity change)
sbi(*_ucsrb, _rxen); //re-enable reception
}
/**
* Cast that converts the given to a bool
*
* @return The result of the operation.
*/
EMSSerial::operator bool() {
return true;
}
#if defined(UBRRH) && defined(UBRRL)
EMSSerial EMSSerial0(&UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR, RXEN, TXEN, RXCIE);
#elif defined(UBRR0H) && defined(UBRR0L)
EMSSerial EMSSerial0(&UBRR0H, &UBRR0L, &UCSR0A, &UCSR0B, &UCSR0C, &UDR0, RXEN0, TXEN0, RXCIE0);
#endif
#if defined(UBRR1H)
EMSSerial EMSSerial1(&UBRR1H, &UBRR1L, &UCSR1A, &UCSR1B, &UCSR1C, &UDR1, RXEN1, TXEN1, RXCIE1);
#endif
#if defined(UBRR2H)
EMSSerial EMSSerial2(&UBRR2H, &UBRR2L, &UCSR2A, &UCSR2B, &UCSR2C, &UDR2, RXEN2, TXEN2, RXCIE2);
#endif
#if defined(UBRR3H)
EMSSerial EMSSerial3(&UBRR3H, &UBRR3L, &UCSR3A, &UCSR3B, &UCSR3C, &UDR3, RXEN3, TXEN3, RXCIE3);
#endif
#pragma endregion EMSSerial
/** CalduinoData definition */
#pragma region CalduinoData
/** Printf formatting options */
prog_char decimal[] = { "%d" };
prog_char unsignedLong[] = { "%lu" };
prog_char returnTag[] = { "Return" };
/** Units for formatting purposes. */
prog_char noneUnit[] = { "" };
prog_char celsiusUnit[] = { "\xC2\xB0\C" };
prog_char yesNoUnit[] = { "Yes/No" };
prog_char mAmperUnit[] = { "mAmper" };
prog_char barUnit[] = { "bar" };
prog_char minuteUnit[] = { "minutes" };
prog_char timesUnit[] = { "times" };
prog_char percentageUnit[] = { "%" };
prog_char dayUnit[] = { "day" };
prog_char switchPointUnit[] = { "" };
prog_char secondUnit[] = { "seconds" };
/** CalduinoUnits Array. */
const prog_char *calduinoUnits[] = {
noneUnit,
celsiusUnit,
yesNoUnit,
mAmperUnit,
barUnit,
minuteUnit,
timesUnit,
percentageUnit,
switchPointUnit,
secondUnit
};
/**
* Decode a Calduino Data of type byte.
*
* @param [in] inEMSBuffer - The EMS bytes received.
*
* @return The value of the Calduino Data in the EMS Buffer received.
*/
byte CalduinoData::decodeByteValue(byte* inEMSBuffer)
{
return (uint8_t)inEMSBuffer[offset];
}
/**
* Decode a Calduino Data of type bit.
*
* @param [in] inEMSBuffer - The EMS bytes received.
*
* @return The value of the Calduino Data in the EMS Buffer received.
*/
bool CalduinoData::decodeBitValue(byte* inEMSBuffer)
{
return (bool)bitRead((uint8_t)inEMSBuffer[offset], bitOffset);
}
/**
* Decode a Calduino Data of type ULong.
*
* @param [in] inEMSBuffer - The EMS bytes received.
*
* @return The value of the Calduino Data in the EMS Buffer received.
*/
unsigned long CalduinoData::decodeULongValue(byte* inEMSBuffer)
{
return (((unsigned long)(uint8_t)inEMSBuffer[offset]) << 16) + (((unsigned long)(uint8_t)inEMSBuffer[offset + 1]) << 8) + ((uint8_t)inEMSBuffer[offset + 2]);
}
/**
* Decode a Calduino Data of type float.
*
* @param [in] inEMSBuffer - The EMS bytes received.
*
* @return The value of the Calduino Data in the EMS Buffer received.
*/
float CalduinoData::decodeFloatValue(byte *inEMSBuffer)
{
return ((floatBytes == 2) ? (((float)((((uint8_t)inEMSBuffer[offset] << 8) + (uint8_t)inEMSBuffer[offset + 1]))) / floatFactor) : ((float)(((int8_t)inEMSBuffer[offset])) / floatFactor));
}
/**
* Decode a Calduino Data of type SwitchPoint.
*
* @param [in] inEMSBuffer - The EMS bytes received.
*
* @return The SwitchPoint value contained in the EMS Buffer received.
*/
SwitchPoint CalduinoData::decodeSwitchPoint(byte *inEMSBuffer)
{
SwitchPoint value = { (offset / 2) - 2, (uint8_t)(inEMSBuffer[offset] & 7), (uint8_t)(inEMSBuffer[offset] >> 5), (uint8_t)(inEMSBuffer[offset + 1] / 6), (uint8_t)((inEMSBuffer[offset + 1] % 6) * 10) };
return value;
}
/**
* Decodes the Calduino Data with the bytes contained in the EMS Buffer and convert returns an
* string containing this decoded value.
*
* @param [in] inEMSBuffer - EMS bytes received.
* @param [out] value - pointer to an array of char elements where the decoded value is
* is stored.
*/
void CalduinoData::decodeValue(byte* inEMSBuffer, char* value)
{
// First decode the value of the CalduinoData contained in inEMSBuffer and convert it to an string in tempBuf
switch (encodeType)
{
case CalduinoEncodeType::Byte:
{
sprintf_P(value, decimal, decodeByteValue(inEMSBuffer));
break;
}
case CalduinoEncodeType::Bit:
{
sprintf_P(value, decimal, decodeBitValue(inEMSBuffer));
break;
}
case CalduinoEncodeType::ULong:
{
sprintf_P(value, unsignedLong, decodeULongValue(inEMSBuffer));
break;
}
case CalduinoEncodeType::Float:
{
dtostrf(decodeFloatValue(inEMSBuffer), 1, 1, value);
break;
}
case CalduinoEncodeType::SwithPoint:
{
SwitchPoint valueSP = decodeSwitchPoint(inEMSBuffer);
sprintf_P(value, PSTR("%d %d %d %d %d"), valueSP.id, valueSP.action, valueSP.day, valueSP.hour, valueSP.minute);
}
}
}
/**
* Composes a formatted string with the CalduinoDataType name and its value. Depending on the
* print format it will be encoded as an XML and will or not include units.
*
* @param [out] str - pointer to an array of char elements where the resulting string
* is stored.
* @param [in] value - value of the current calduino data to be printed.
* @param printFormat - active printing format.
*/
void CalduinoData::printfValue(char* str, char* value, PrintFormat printFormat)
{
// Second compose the output string according to the printFormat
switch (printFormat)
{
case PrintFormat::NoUnit:
{
snprintf_P(str, TEXT_BUFFER_SIZE, PSTR("%S: %s"), dataName, value);
break;
}
case PrintFormat::XML:
{
snprintf_P(str, TEXT_BUFFER_SIZE, PSTR("<%S>%s</%S>"), dataName, value, dataName);
break;
}
case PrintFormat::Standard:
{
snprintf_P(str, TEXT_BUFFER_SIZE, PSTR("%S: %s %S"), dataName, value, calduinoUnits[unit]);
break;
}
}
}
#pragma endregion CalduinoData
/** EMSDatagram definition */
#pragma region EMSDatagram
/** RC Datetime Datagram */
prog_char rCDatetimeName[] = { "RCDatetime" };
prog_char year[] = { "Year" };
prog_char month[] = { "Month" };
prog_char day[] = { "Day" };
prog_char hour[] = { "Hour" };
prog_char minute[] = { "Minute" };
prog_char second[] = { "Second" };
const PROGMEM CalduinoData rCDatetimeValues[] =
{
{ year, CalduinoEncodeType::Byte, CalduinoUnit::None, 4 },
{ month, CalduinoEncodeType::Byte, CalduinoUnit::None, 5 },
{ day, CalduinoEncodeType::Byte, CalduinoUnit::None, 7 },
{ hour, CalduinoEncodeType::Byte, CalduinoUnit::None, 6 },
{ minute, CalduinoEncodeType::Byte, CalduinoUnit::None, 8 },
{ second, CalduinoEncodeType::Byte, CalduinoUnit::None, 9 }
};
const PROGMEM EMSDatagram rCDatetime = { rCDatetimeName, MessageID::RC_Datetime_ID, DeviceID::RC_35, RC_DATETIME_MESSAGE_SIZE, RC_DATETIME_VALUES_COUNT, rCDatetimeValues };
/** UBA Working Time Datagram */
prog_char uBAWorkingTimeName[] = { "UBAWorkingTime" };
prog_char uBAWorkingMin[] = { "UBAWorkMin" };
const PROGMEM CalduinoData uBAWorkingTimeValues[] = {
{uBAWorkingMin, CalduinoEncodeType::ULong, CalduinoUnit::Minute, 4}
};
const PROGMEM EMSDatagram uBAWorkingTime = { uBAWorkingTimeName, MessageID::UBA_Working_Time_ID, DeviceID::UBA, UBA_WORKING_TIME_MESSAGE_SIZE, UBA_WORKING_TIME_VALUES_COUNT, uBAWorkingTimeValues };
/** UBA Monitor Fast Datagram */
prog_char uBAMonitorFastName[] = { "UBAMonitorFast" };
prog_char selImpTemp[] = { "SelImpTemp" };
prog_char curImpTemp[] = { "CurImpTemp" };
prog_char retTemp[] = { "RetTemp" };
prog_char selBurnPow[] = { "SelBurnPow" };
prog_char curBurnPow[] = { "CurBurnPow" };
prog_char flameCurr[] = { "FlameCurr" };
prog_char sysPress[] = { "SysPress" };
prog_char burnGas[] = { "BurnGas" };
prog_char fanWork[] = { "FanWork" };
prog_char ignWork[] = { "IgnWork" };
prog_char heatPmp[] = { "HeatPmp" };
prog_char threeWayValveDHW[] = { "Way3ValveDHW" };
prog_char circDHW[] = { "CircDHW" };
prog_char srvCode1[] = { "SrvCode1" };
prog_char srvCode2[] = { "SrvCode2" };
prog_char errCode[] = { "ErrCode" };
const PROGMEM CalduinoData uBAMonitorFastValues[] = {
{selImpTemp, CalduinoEncodeType::Byte, CalduinoUnit::Celsius, 4},
{curImpTemp, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 5, 0, 2, 10},
{selBurnPow, CalduinoEncodeType::Byte, CalduinoUnit::Percentage, 7},
{curBurnPow, CalduinoEncodeType::Byte, CalduinoUnit::Percentage, 8},
{burnGas, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 11, 0},
{fanWork, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 11, 2},
{ignWork, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 11, 3},
{heatPmp, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 11, 5},
{threeWayValveDHW, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 11, 6},
{circDHW, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 11, 7},
{retTemp, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 17, 0, 2, 10},
{flameCurr, CalduinoEncodeType::Float, CalduinoUnit::MAmper, 19, 0, 2, 10},
{sysPress, CalduinoEncodeType::Float, CalduinoUnit::Bar, 21, 0, 1, 10},
{srvCode1, CalduinoEncodeType::Byte, CalduinoUnit::None, 22},
{srvCode2, CalduinoEncodeType::Byte, CalduinoUnit::None, 23},
{errCode, CalduinoEncodeType::Float, CalduinoUnit::None, 24, 0, 2, 1}
};
const PROGMEM EMSDatagram uBAMonitorFast = { uBAMonitorFastName, MessageID::UBA_Monitor_Fast_ID, DeviceID::UBA, UBA_MONITOR_FAST_MESSAGE_SIZE, UBA_MONITOR_FAST_VALUES_COUNT, uBAMonitorFastValues };
/** UBA Monitor Slow Datagram */
prog_char uBAMonitorSlowName[] = { "UBAMonitorSlow" };
prog_char extTemp[] = { "ExtTemp" };
prog_char boilTemp[] = { "BoilTemp" };
prog_char pumpMod[] = { "PumpMod" };
prog_char burnStarts[] = { "BurnStarts" };
prog_char burnWorkMin[] = { "BurnWorkMin" };
prog_char burnWorkMinH[] = { "BurnWorkMinH" };
const PROGMEM CalduinoData uBAMonitorSlowValues[] = {
{extTemp, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 4, 0, 2, 10},
{boilTemp, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 6, 0, 2, 10},
{pumpMod, CalduinoEncodeType::Byte, CalduinoUnit::Percentage, 13},
{burnStarts, CalduinoEncodeType::ULong, CalduinoUnit::Times, 14},
{burnWorkMin, CalduinoEncodeType::ULong, CalduinoUnit::Minute, 17},
{burnWorkMinH, CalduinoEncodeType::ULong, CalduinoUnit::Minute, 23}
};
const PROGMEM EMSDatagram uBAMonitorSlow = { uBAMonitorSlowName, MessageID::UBA_Monitor_Slow_ID, DeviceID::UBA, UBA_MONITOR_SLOW_MESSAGE_SIZE, UBA_MONITOR_SLOW_VALUES_COUNT, uBAMonitorSlowValues };
/** UBA Parameter DHW Datagram */
prog_char uBAParameterDHWName[] = { "UBAParameterDHW" };
prog_char selTempDHW[] = { "SelTempDHW" };
prog_char tempTDDHW[] = { "SelTempTDDHW" };
const PROGMEM CalduinoData uBAParameterDHWValues[] = {
{selTempDHW, CalduinoEncodeType::Byte, CalduinoUnit::Celsius, 6},
{tempTDDHW, CalduinoEncodeType::Byte, CalduinoUnit::Celsius, 12}
};
const PROGMEM EMSDatagram uBAParameterDHW = { uBAParameterDHWName, MessageID::UBA_Parameter_DHW_ID, DeviceID::UBA, UBA_PARAMETER_DHW_MESSAGE_SIZE, UBA_PARAMETER_DHW_VALUES_COUNT, uBAParameterDHWValues };
/** UBA Monitor DHW Datagram */
prog_char uBAMonitorDHWName[] = { "UBAMonitorDHW" };
prog_char curTempDHW[] = { "CurTempDHW" };
prog_char dayModeDHW[] = { "DayModeDHW" };
prog_char oneTimeDHW[] = { "OneTimeDHW" };
prog_char desDHW[] = { "DesDHW" };
prog_char prepareDHW[] = { "PrepareDHW" };
prog_char burnWorkMinDHW[] = { "BurnWorkMinDHW" };
prog_char burnStartsDHW[] = { "BurnStartsDHW" };
const PROGMEM CalduinoData uBAMonitorDHWValues[] = {
{curTempDHW, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 5, 0, 2, 10},
{dayModeDHW, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 9, 0},
{oneTimeDHW, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 9, 1},
{desDHW, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 9, 2},
{prepareDHW, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 9, 3},
{burnWorkMinDHW, CalduinoEncodeType::ULong, CalduinoUnit::Minute, 14},
{burnStartsDHW, CalduinoEncodeType::ULong, CalduinoUnit::Times, 17}
};
const PROGMEM EMSDatagram uBAMonitorDHW = { uBAMonitorDHWName, MessageID::UBA_Monitor_DHW_ID, DeviceID::UBA, UBA_MONITOR_DHW_MESSAGE_SIZE, UBA_MONITOR_DHW_VALUES_COUNT, uBAMonitorDHWValues };
/** UBA Flags DHW Datagram */
prog_char flagsDHWName[] = { "FlagsDHW" };
const PROGMEM CalduinoData uBAflagsDHWValues[] = {
{ oneTimeDHW, CalduinoEncodeType::Byte, CalduinoUnit::Celsius, 4 }
};
const PROGMEM EMSDatagram uBAFlagsDHW = { flagsDHWName, MessageID::Flags_DHW_ID, DeviceID::UBA, FLAGS_DHW_MESSAGE_SIZE, FLAGS_DHW_VALUES_COUNT, uBAflagsDHWValues };
/** Working Mode DHW Datagram */
prog_char workingModeDHWName[] = { "WorkingModeDHW" };
prog_char progDHW[] = { "ProgDHW" };
prog_char progPumpDHW[] = { "ProgPumpDHW" };
prog_char workModeDHW[] = { "WorkModeDHW" };
prog_char workModePumpDHW[] = { "WorkModePumpDHW" };
prog_char workModeTDDHW[] = { "WorkModeTDDHW" };
prog_char dayTDDHW[] = { "DayTDDHW" };
prog_char hourTDDHW[] = { "HourTDDHW" };
const PROGMEM CalduinoData workingModeDHWValues[] = {
{progDHW, CalduinoEncodeType::Byte, CalduinoUnit::None, 4},
{progPumpDHW, CalduinoEncodeType::Byte, CalduinoUnit::None, 5},
{workModeDHW, CalduinoEncodeType::Byte, CalduinoUnit::None, 6},
{workModePumpDHW, CalduinoEncodeType::Byte, CalduinoUnit::None, 7},
{workModeTDDHW, CalduinoEncodeType::Byte, CalduinoUnit::YesNo, 8},
{dayTDDHW, CalduinoEncodeType::Byte, CalduinoUnit::None, 9},
{hourTDDHW, CalduinoEncodeType::Byte, CalduinoUnit::None, 10}
};
const PROGMEM EMSDatagram workingModeDHW = { workingModeDHWName, MessageID::Working_Mode_DHW_ID, DeviceID::RC_35, WORKING_MODE_DHW_MESSAGE_SIZE, WORKING_MODE_DHW_VALUES_COUNT, workingModeDHWValues };
/** Working Mode HC Datagram */
prog_char workingModeHC1Name[] = { "WorkingModeHC1" };
prog_char workingModeHC2Name[] = { "WorkingModeHC2" };
prog_char workingModeHC3Name[] = { "WorkingModeHC3" };
prog_char workingModeHC4Name[] = { "WorkingModeHC4" };
prog_char selNightTempHC[] = { "SelNightTempHC" };
prog_char selDayTempHC[] = { "SelDayTempHC" };
prog_char selHoliTempHC[] = { "SelHoliTempHC" };
prog_char roomTempInfHC[] = { "RoomTempInfHC" };
prog_char roomTempOffHC[] = { "RoomTempOffHC" };
prog_char workModeHC[] = { "WorkModeHC" };
prog_char sWThresTempHC[] = { "SWThresTempHC" };
prog_char nightSetbackHC[] = { "NightSetbackHC" };
prog_char nightOutTempHC[] = { "NightOutTempHC" };
const PROGMEM CalduinoData workingModeHCValues[] = {
{selNightTempHC, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 5, 0, 1, 2},
{selDayTempHC, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 6, 0, 1, 2},
{selHoliTempHC, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 7, 0, 1, 2},
{roomTempInfHC, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 8, 0, 1, 2},
{roomTempOffHC, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 10, 0, 1, 2},
{workModeHC, CalduinoEncodeType::Byte, CalduinoUnit::None, 11},
{sWThresTempHC, CalduinoEncodeType::Byte, CalduinoUnit::Celsius, 26},
{nightSetbackHC, CalduinoEncodeType::Byte, CalduinoUnit::None, 29},
{nightOutTempHC, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 43, 0, 1, 1}
};
const PROGMEM EMSDatagram workingModeHC1 = { workingModeHC1Name, MessageID::Working_Mode_HC_1_ID, DeviceID::RC_35, WORKING_MODE_HC_MESSAGE_SIZE, WORKING_MODE_HC_VALUES_COUNT, workingModeHCValues };
const PROGMEM EMSDatagram workingModeHC2 = { workingModeHC2Name, MessageID::Working_Mode_HC_2_ID, DeviceID::RC_35, WORKING_MODE_HC_MESSAGE_SIZE, WORKING_MODE_HC_VALUES_COUNT, workingModeHCValues };
const PROGMEM EMSDatagram workingModeHC3 = { workingModeHC3Name, MessageID::Working_Mode_HC_3_ID, DeviceID::RC_35, WORKING_MODE_HC_MESSAGE_SIZE, WORKING_MODE_HC_VALUES_COUNT, workingModeHCValues };
const PROGMEM EMSDatagram workingModeHC4 = { workingModeHC4Name, MessageID::Working_Mode_HC_4_ID, DeviceID::RC_35, WORKING_MODE_HC_MESSAGE_SIZE, WORKING_MODE_HC_VALUES_COUNT, workingModeHCValues };
/** Monitor HC Datagram */
prog_char monitorHC1Name[] = { "MonitorHC1" };
prog_char monitorHC2Name[] = { "MonitorHC2" };
prog_char monitorHC3Name[] = { "MonitorHC3" };
prog_char monitorHC4Name[] = { "MonitorHC4" };
prog_char holiModHC[] = { "HoliModHC" };
prog_char summerModHC[] = { "SummerModHC" };
prog_char dayModHC[] = { "DayModHC" };
prog_char pauseModHC[] = { "PauseModHC" };
prog_char selRoomTempHC[] = { "SelRoomTempHC" };
const PROGMEM CalduinoData monitorHCValues[] = {
{holiModHC, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 4, 5},
{summerModHC, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 5, 0},
{dayModHC, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 5, 1},
{pauseModHC, CalduinoEncodeType::Bit, CalduinoUnit::YesNo, 5, 7},
{selRoomTempHC, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 6, 0, 1, 2}
};
const PROGMEM EMSDatagram monitorHC1 = { monitorHC1Name, MessageID::Monitor_HC_1_ID, DeviceID::RC_35, MONITOR_HC_MESSAGE_SIZE, MONITOR_HC_VALUES_COUNT, monitorHCValues };
const PROGMEM EMSDatagram monitorHC2 = { monitorHC2Name, MessageID::Monitor_HC_2_ID, DeviceID::RC_35, MONITOR_HC_MESSAGE_SIZE, MONITOR_HC_VALUES_COUNT, monitorHCValues };
const PROGMEM EMSDatagram monitorHC3 = { monitorHC3Name, MessageID::Monitor_HC_3_ID, DeviceID::RC_35, MONITOR_HC_MESSAGE_SIZE, MONITOR_HC_VALUES_COUNT, monitorHCValues };
const PROGMEM EMSDatagram monitorHC4 = { monitorHC4Name, MessageID::Monitor_HC_4_ID, DeviceID::RC_35, MONITOR_HC_MESSAGE_SIZE, MONITOR_HC_VALUES_COUNT, monitorHCValues };
/** Switching Program Datagram */
prog_char programDHWName[] = { "ProgramDHW" };
prog_char programPumpDHWName[] = { "ProgramPumpDHW" };
prog_char program1HC1Name[] = { "Program1HC1" };
prog_char program1HC2Name[] = { "Program1HC2" };
prog_char program1HC3Name[] = { "Program1HC3" };
prog_char program1HC4Name[] = { "Program1HC4" };
prog_char program2HC1Name[] = { "Program2HC1" };
prog_char program2HC2Name[] = { "Program2HC2" };
prog_char program2HC3Name[] = { "Program2HC3" };
prog_char program2HC4Name[] = { "Program2HC4" };
prog_char switchPoint[] = { "SwitchPoint" };
prog_char programName[] = { "ProgramName" };
prog_char pauseTime[] = { "PauseTime" };
prog_char partyTime[] = { "PartyTime" };
prog_char startHolidayDay[] = { "StartHoliDay" };
prog_char startHolidayMonth[] = { "StartHoliMonth" };
prog_char startHolidayYear[] = { "StartHoliYear" };
prog_char endHolidayDay[] = { "EndHoliDay" };
prog_char endHolidayMonth[] = { "EndHoliMonth" };
prog_char endHolidayYear[] = { "EndHoliYear" };
prog_char startHomeHolidayDay[] = { "StartHHolDay" };
prog_char startHomeHolidayMonth[] = { "StartHHoliMonth" };
prog_char startHomeHolidayYear[] = { "StartHHoliYear" };
prog_char endHomeHolidayDay[] = { "EndHHoliDay" };
prog_char endHomeHolidayMonth[] = { "EndHHoliMonth" };
prog_char endHomeHolidayYear[] = { "EndHHoliYear" };
const PROGMEM CalduinoData switchingProgramValues[] = {
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 4},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 6},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 8},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 10},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 12},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 14},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 16},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 18},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 20},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 22},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 24}, //10
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 26},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 28},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 30},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 32},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 34},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 36},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 38},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 40},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 42},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 44}, //20
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 46},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 48},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 50},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 52},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 54},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 56},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 58},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 60},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 62},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 64}, //30
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 66},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 68},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 70},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 72},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 74},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 76},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 78},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 80},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 82},
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 84}, //40
{switchPoint, CalduinoEncodeType::SwithPoint, CalduinoUnit::None, 86},
{programName, CalduinoEncodeType::Byte, CalduinoUnit::None, 88},
{pauseTime, CalduinoEncodeType::Byte, CalduinoUnit::None, 89},
{partyTime, CalduinoEncodeType::Byte, CalduinoUnit::None, 90},
{startHolidayDay, CalduinoEncodeType::Byte, CalduinoUnit::None, 91},
{startHolidayMonth, CalduinoEncodeType::Byte, CalduinoUnit::None, 92},
{startHolidayYear, CalduinoEncodeType::Byte, CalduinoUnit::None, 93},
{endHolidayDay, CalduinoEncodeType::Byte, CalduinoUnit::None, 94},
{endHolidayMonth, CalduinoEncodeType::Byte, CalduinoUnit::None, 95},
{endHolidayYear, CalduinoEncodeType::Byte, CalduinoUnit::None, 96}, //50
{startHomeHolidayDay, CalduinoEncodeType::Byte, CalduinoUnit::None, 97},
{startHomeHolidayMonth, CalduinoEncodeType::Byte, CalduinoUnit::None, 98},
{startHomeHolidayYear, CalduinoEncodeType::Byte, CalduinoUnit::None, 99},
{endHomeHolidayDay, CalduinoEncodeType::Byte, CalduinoUnit::None, 100},
{endHomeHolidayMonth, CalduinoEncodeType::Byte, CalduinoUnit::None, 101},
{endHomeHolidayYear, CalduinoEncodeType::Byte, CalduinoUnit::None, 102}
};
const PROGMEM EMSDatagram program1HC1 = { program1HC1Name, MessageID::Program_1_HC_1_ID, DeviceID::RC_35, SWITCHING_PROGRAM_1_MESSAGE_SIZE, SWITCHING_PROGRAM_1_VALUES_COUNT, switchingProgramValues };
const PROGMEM EMSDatagram program1HC2 = { program1HC2Name, MessageID::Program_1_HC_2_ID, DeviceID::RC_35, SWITCHING_PROGRAM_1_MESSAGE_SIZE, SWITCHING_PROGRAM_1_VALUES_COUNT, switchingProgramValues };
const PROGMEM EMSDatagram program1HC3 = { program1HC3Name, MessageID::Program_1_HC_3_ID, DeviceID::RC_35, SWITCHING_PROGRAM_1_MESSAGE_SIZE, SWITCHING_PROGRAM_1_VALUES_COUNT, switchingProgramValues };
const PROGMEM EMSDatagram program1HC4 = { program1HC4Name, MessageID::Program_1_HC_4_ID, DeviceID::RC_35, SWITCHING_PROGRAM_1_MESSAGE_SIZE, SWITCHING_PROGRAM_1_VALUES_COUNT, switchingProgramValues };
const PROGMEM EMSDatagram program2HC1 = { program2HC1Name, MessageID::Program_2_HC_1_ID, DeviceID::RC_35, SWITCHING_PROGRAM_2_MESSAGE_SIZE, SWITCHING_PROGRAM_2_VALUES_COUNT, switchingProgramValues };
const PROGMEM EMSDatagram program2HC2 = { program2HC2Name, MessageID::Program_2_HC_2_ID, DeviceID::RC_35, SWITCHING_PROGRAM_2_MESSAGE_SIZE, SWITCHING_PROGRAM_2_VALUES_COUNT, switchingProgramValues };
const PROGMEM EMSDatagram program2HC3 = { program2HC3Name, MessageID::Program_2_HC_3_ID, DeviceID::RC_35, SWITCHING_PROGRAM_2_MESSAGE_SIZE, SWITCHING_PROGRAM_2_VALUES_COUNT, switchingProgramValues };
const PROGMEM EMSDatagram program2HC4 = { program2HC4Name, MessageID::Program_2_HC_4_ID, DeviceID::RC_35, SWITCHING_PROGRAM_2_MESSAGE_SIZE, SWITCHING_PROGRAM_2_VALUES_COUNT, switchingProgramValues };
const PROGMEM EMSDatagram programDHW = { programDHWName, MessageID::Program_DHW_ID, DeviceID::RC_35, SWITCHING_PROGRAM_1_MESSAGE_SIZE, SWITCHING_PROGRAM_1_VALUES_COUNT, switchingProgramValues };
const PROGMEM EMSDatagram programPumpDHW = { programPumpDHWName, MessageID::Program_Pump_DHW_ID, DeviceID::RC_35, SWITCHING_PROGRAM_1_MESSAGE_SIZE, SWITCHING_PROGRAM_1_VALUES_COUNT, switchingProgramValues };
/** Monitor MM10 Datagram */
prog_char monitorMM10Name[] = { "MonitorMM10" };
prog_char selImpTempMM10[] = { "SelImpTempMM10" };
prog_char curImpTempMM10[] = { "CurImpTempMM10" };
prog_char statusMM10[] = { "ModMM10" };
const PROGMEM CalduinoData monitorMM10Values[] = {
{selImpTempMM10, CalduinoEncodeType::Byte, CalduinoUnit::Celsius, 4},
{curImpTempMM10, CalduinoEncodeType::Float, CalduinoUnit::Celsius, 5, 0, 2, 10},
{statusMM10, CalduinoEncodeType::Byte, CalduinoUnit::Percentage, 7}
};
const PROGMEM EMSDatagram monitorMM10 = { monitorMM10Name, MessageID::Monitor_MM_10_ID, DeviceID::MM_10, MONITOR_MM_10_MESSAGE_SIZE, MONITOR_MM_10_VALUES_COUNT, monitorMM10Values };
/** EMS Datagram Array , pointer to the defined EMS Datagrams */
EMSDatagram* eMSDatagramIDs[] =
{
&rCDatetime,
&uBAWorkingTime,
&uBAMonitorFast,
&uBAMonitorSlow,
&uBAParameterDHW,
&uBAMonitorDHW,
&uBAFlagsDHW,
&workingModeDHW,
&programDHW,