Skip to content

Commit 0b40132

Browse files
committed
handles mime type strings for output now
1 parent 90575a5 commit 0b40132

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/Flux/flxSerial.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,23 @@ class flxSerial_ : public flxWriter
4949
{
5050
Serial.println(value);
5151
}
52-
void write(const char *value, bool newline)
52+
void write(const char *value, bool newline, flxLineType_t type)
5353
{
54-
if (newline)
54+
55+
// If this is a header, we add a stream indicator to the output
56+
// tart the stream with a Mime Type marker, followed by CR
57+
if (type == flxLineTypeMime){
58+
Serial.println();
5559
Serial.println(value);
56-
else
57-
Serial.print(value);
60+
Serial.println();
61+
}
62+
else
63+
{
64+
if (newline)
65+
Serial.println(value);
66+
else
67+
Serial.print(value);
68+
}
5869
}
5970

6071
// Overload listen, so we can type the events, and use the templated

0 commit comments

Comments
 (0)