Added wifi state output as version.
This commit is contained in:
@@ -14,9 +14,6 @@
|
||||
#include "SerialCommand.h"
|
||||
#include "button.h"
|
||||
|
||||
// implemented Eggbot-Protocol-Version v13
|
||||
#define initSting "EBBv13_and_above Protocol emulated by Eggduino-Firmware V1.6a"
|
||||
|
||||
#ifdef ESP32
|
||||
|
||||
// Rotational Stepper
|
||||
@@ -104,6 +101,7 @@ extern int g_iMaxAcclSpeed;
|
||||
extern String g_sHostname;
|
||||
extern String g_sWifiSsid;
|
||||
extern String g_sWifiPassword;
|
||||
extern String g_strConnectionState;
|
||||
|
||||
enum ProtocolTransport {
|
||||
PROTOCOL_TRANSPORT_SERIAL = 0,
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <DNSServer.h>
|
||||
#include <string.h>
|
||||
|
||||
String g_strConnectionState = "No Wifi connection";
|
||||
|
||||
namespace
|
||||
{
|
||||
const char *kConfigPath = "/config.json";
|
||||
@@ -594,7 +596,8 @@ void startWebInterface()
|
||||
staConnectionKnown = staConnected;
|
||||
if (staConnected)
|
||||
{
|
||||
Serial.println(String("Connected: http://") + WiFi.localIP().toString());
|
||||
g_strConnectionState = String("Connected: http://") + WiFi.localIP().toString();
|
||||
Serial.println(g_strConnectionState);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -620,7 +623,8 @@ void startWebInterface()
|
||||
{
|
||||
apModeActive = true;
|
||||
dnsServer.start(kDnsPort, "*", WiFi.softAPIP());
|
||||
Serial.println(String("AP aktiv: ") + hostName + " / http://" + WiFi.softAPIP().toString() + " (Name: " + hostName + ")");
|
||||
g_strConnectionState = String("AP aktiv: http://" + WiFi.softAPIP().toString() + " (" + hostName + ")");
|
||||
Serial.println(g_strConnectionState);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -319,10 +319,11 @@ void stepperModeConfigure()
|
||||
void sendVersion()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
protocolWrite(initSting);
|
||||
protocolWrite("EBB: " + g_strConnectionState);
|
||||
protocolWrite("\r\n");
|
||||
}
|
||||
|
||||
|
||||
void unrecognized(const char *command)
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
|
||||
Reference in New Issue
Block a user