mirror of
https://gitlab.com/zwirbel/illucat.git
synced 2025-12-15 01:42:22 +01:00
update mqtt, implement basic chat fnc
This commit is contained in:
@@ -45,10 +45,9 @@ void setup()
|
|||||||
webServerPlugin->server->serveStatic(MQTT_CONFIG_FILE, SPIFFS, "mqttConfig.json");
|
webServerPlugin->server->serveStatic(MQTT_CONFIG_FILE, SPIFFS, "mqttConfig.json");
|
||||||
|
|
||||||
const char* mqttChatTopic = (String(MQTT_ROOT_TOPIC) + "/out/chat/log").c_str();
|
const char* mqttChatTopic = (String(MQTT_ROOT_TOPIC) + "/out/chat/log").c_str();
|
||||||
sprocket->subscribe("chat/log", [](String msg) {
|
sprocket->subscribe("chat/log", [mqttChatTopic](String msg) {
|
||||||
PRINT_MSG(Serial, "CHAT", msg.c_str());
|
PRINT_MSG(Serial, "CHAT", msg.c_str());
|
||||||
});
|
});
|
||||||
|
|
||||||
sprocket->subscribe("mqtt/connect", [mqttChatTopic](String msg) {
|
sprocket->subscribe("mqtt/connect", [mqttChatTopic](String msg) {
|
||||||
if (msg.length() > 0)
|
if (msg.length() > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user