We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f76290 commit 5fdd37aCopy full SHA for 5fdd37a
InfluxDb.cpp
@@ -29,8 +29,18 @@ void Influxdb::setDb(String db) {
29
http.addHeader("Content-Type", "text/plain");
30
}
31
32
-// TODO: set db with user & password
33
-
+/**
+ * Set the database to be used with authentication.
34
+ */
35
+void Influxdb::setDbAuth(String db, String user, String pass) {
36
+ _db = String(db);
37
+ _user = user;
38
+ _pass = pass;
39
+ // TODO: recreate client on db change
40
+ // http = new HTTPClient();
41
+ http.begin(_host, _port, "/write?u=" + _user + "&p=" + _pass + "&db=" + _db );
42
+ http.addHeader("Content-Type", "text/plain");
43
+}
44
/**
45
* Prepare a measurement to be sent.
46
*/
0 commit comments