Get IP address out of class files

This commit is contained in:
Arne van Iterson 2024-03-10 17:43:20 +01:00
parent bceda8433b
commit 79968b727a
2 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,10 @@
#include <WiFi.h> #include <WiFi.h>
#include <WiFiMulti.h> #include <WiFiMulti.h>
// MQTT
#define MQTT_ADDR "192.168.2.196"
#define MQTT_PORT 1883
// DAC // DAC
#define DAC1 25 #define DAC1 25

View File

@ -2,9 +2,10 @@
MqttTopic::MqttTopic(WiFiClient* espClient): wifiClient(espClient), client(PubSubClient(*espClient)) MqttTopic::MqttTopic(WiFiClient* espClient): wifiClient(espClient), client(PubSubClient(*espClient))
{ {
IPAddress server(192, 168, 2, 196); IPAddress server;
server.fromString(MQTT_ADDR);
this->client.setServer(server, 1883); this->client.setServer(server, MQTT_PORT);
this->client.setCallback(this->callback); this->client.setCallback(this->callback);
} }