kopia lustrzana https://github.com/martin-ger/esp_mqtt
fixed remote publish
rodzic
10f292f27e
commit
13f58ddfad
2
Makefile
2
Makefile
|
@ -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.
|
@ -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");
|
||||
|
|
Ładowanie…
Reference in New Issue