fixed remote publish

pull/16/head
Martin Ger 2017-06-22 16:25:24 +02:00
rodzic 10f292f27e
commit 13f58ddfad
4 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -33,7 +33,7 @@ ESPPORT ?= /dev/ttyUSB0
TARGET = app
# which modules (subdirectories) of the project to include in compiling
MODULES = driver user mqtt
MODULES = driver user mqtt
#EXTRA_INCDIR = $(BUILD_AREA)/esp-open-sdk/esp-open-lwip/include include
EXTRA_INCDIR = include

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -384,7 +384,7 @@ void ICACHE_FLASH_ATTR console_handle_command(struct espconn *pespconn)
if (strcmp(tokens[0], "publish") == 0)
{
if (nTokens != 3) {
if (nTokens != 4) {
os_sprintf(response, INVALID_NUMARGS);
goto command_handled;
}
@ -393,7 +393,7 @@ void ICACHE_FLASH_ATTR console_handle_command(struct espconn *pespconn)
}
#ifdef MQTT_CLIENT
else if (strcmp(tokens[1], "remote") == 0 && mqtt_connected) {
MQTT_Publish(&mqttClient, tokens[2], tokens[2], os_strlen(tokens[2]), 0, 0);
MQTT_Publish(&mqttClient, tokens[2], tokens[3], os_strlen(tokens[3]), 0, 0);
}
#endif
os_sprintf(response, "Published topic\r\n");