Skip to content

Commit b4c982d

Browse files
authored
Merge pull request #97 from cpainchaud/cpainchaud-oregon-patch
Update Plugin_048 Oregon protocols
2 parents 1773b1d + c5bc83a commit b4c982d

File tree

5 files changed

+1000
-1126
lines changed

5 files changed

+1000
-1126
lines changed

RFLink/4_Display.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ void display_Name(const char *input)
3636
strcat(pbuffer, dbuffer);
3737
}
3838

39+
void display_NameEx(const char *name, unsigned int id)
40+
{
41+
sprintf_P(dbuffer, PSTR(";%s-%04X"), name, id);
42+
strcat(pbuffer, dbuffer);
43+
}
44+
3945
// Common Footer
4046
void display_Footer(void)
4147
{
@@ -211,6 +217,13 @@ void display_RAIN(unsigned int input)
211217
strcat(pbuffer, dbuffer);
212218
}
213219

220+
// RAINTOT=1234 => Total rain in mm. (hexadecimal) 0x8d = 141 decimal = 14.1 mm (needs division by 10)
221+
void display_RAINTOT(unsigned int input)
222+
{
223+
sprintf_P(dbuffer, PSTR("%s%04x"), PSTR(";RAINTOT="), input);
224+
strcat(pbuffer, dbuffer);
225+
}
226+
214227
// RAINRATE=1234 => Rain rate in mm. (hexadecimal) 0x8d = 141 decimal = 14.1 mm (needs division by 10)
215228
void display_RAINRATE(unsigned int input)
216229
{
@@ -358,6 +371,21 @@ void display_CHAN(byte channel)
358371
strcat(pbuffer, dbuffer);
359372
}
360373

374+
// DEBUG=..... => provide DEBUG Data
375+
void display_DEBUG(byte data[], unsigned int size)
376+
{
377+
sprintf_P(dbuffer, PSTR("%s"), PSTR(";DEBUG="));
378+
strcat(pbuffer, dbuffer);
379+
380+
char buffer[size*2 + 1];
381+
for (unsigned int i = 0; i < size; i++)
382+
{
383+
sprintf_P(buffer+i*2, PSTR("%02x"), data[i]);
384+
}
385+
386+
strcat(pbuffer, buffer);
387+
}
388+
361389
// --------------------- //
362390
// get label shared func //
363391
// --------------------- //

RFLink/4_Display.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extern char pbuffer[PRINT_BUFFER_SIZE]; // Buffer for printing data
1717

1818
void display_Header(void);
1919
void display_Name(const char *);
20+
void display_NameEx(const char *name, unsigned int id);
2021
void display_Footer(void);
2122
void display_Splash(void);
2223
void display_IDn(unsigned long, byte);
@@ -52,6 +53,7 @@ void display_UV(unsigned int);
5253
void display_LUX(unsigned int);
5354
void display_BAT(boolean);
5455
void display_RAIN(unsigned int);
56+
void display_RAINTOT(unsigned int);
5557
void display_RAINRATE(unsigned int);
5658
void display_WINSP(unsigned int);
5759
void display_AWINSP(unsigned int);
@@ -81,6 +83,7 @@ void display_DIST(unsigned int);
8183
void display_METER(unsigned int);
8284
void display_VOLT(unsigned int);
8385
void display_RGBW(unsigned int);
86+
void display_DEBUG(byte data[], unsigned int size);
8487

8588
// These functions are here to help writing the emitting part of a plugin by interpreting the received command
8689
// A local copy of the original InputBuffer_Serial is split by semi colons into tokens seperated when calling

0 commit comments

Comments
 (0)