Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions InfluxArduino.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <HTTPClient.h>
#include "InfluxArduino.hpp"

InfluxArduino::InfluxArduino()
InfluxArduino::InfluxArduino(bool debug)
{
}

Expand Down Expand Up @@ -43,7 +43,7 @@ void InfluxArduino::authorize(const char username[], const char password[])

bool InfluxArduino::write(const char *measurement,const char *fieldString)
{
write(measurement,"",fieldString);
return write(measurement,"",fieldString);
}

bool InfluxArduino::write(const char *measurement,const char *tagString,const char *fieldString)
Expand Down Expand Up @@ -78,7 +78,7 @@ bool InfluxArduino::write(const char *measurement,const char *tagString,const ch
//no tags
sprintf(writeBuf,"%s %s",measurement,fieldString); //no comma between tags and fields
}
Serial.println(writeBuf);
if(debug) Serial.println(writeBuf);
_latestResponse = http.POST(writeBuf);
http.end();
return _latestResponse == 204;
Expand All @@ -92,4 +92,4 @@ int InfluxArduino::getResponse()
bool InfluxArduino::isSecure()
{
return _isSecure;
}
}
6 changes: 5 additions & 1 deletion InfluxArduino.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
class InfluxArduino
{
public:
InfluxArduino();

bool debug;

InfluxArduino(bool debug=false);

~InfluxArduino();

//specify the database, IP address and port (optional) for the database
Expand Down