Skip to content

Commit

Permalink
fix issue so that a header line is only written once - after mime typ…
Browse files Browse the repository at this point in the history
…e line
  • Loading branch information
gigapod committed May 2, 2023
1 parent 2125069 commit d956e6b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/Flux/flxSerial.h
Original file line number Diff line number Diff line change
@@ -53,11 +53,23 @@ class flxSerial_ : public flxWriter
{

// If this is a header, we add a stream indicator to the output
// tart the stream with a Mime Type marker, followed by CR
// start the stream with a Mime Type marker, followed by CR
if (type == flxLineTypeMime){
Serial.println();
Serial.println(value);
Serial.println();

// next we'll want to do a header
_headerWritten = false;
}
else if (type == flxLineTypeHeader)
{
// only want to write this out once
if (_headerWritten == false)
{
Serial.println(value);
_headerWritten = true;
}
}
else
{
@@ -93,7 +105,8 @@ class flxSerial_ : public flxWriter
void operator=(flxSerial_ const &) = delete;

private:
flxSerial_(){};
flxSerial_() : _headerWritten{false}{};
bool _headerWritten;
};

typedef flxSerial_ *flxSerial;

0 comments on commit d956e6b

Please sign in to comment.