kopia lustrzana https://github.com/martin-ger/esp_mqtt
commit
d4fd20005c
|
@ -240,6 +240,7 @@ mqtt_tcpclient_recv(void *arg, char *pdata, unsigned short len)
|
||||||
struct espconn *pCon = (struct espconn*)arg;
|
struct espconn *pCon = (struct espconn*)arg;
|
||||||
MQTT_Client *client = (MQTT_Client *)pCon->reverse;
|
MQTT_Client *client = (MQTT_Client *)pCon->reverse;
|
||||||
|
|
||||||
|
client->keepAliveTick = 0;
|
||||||
READPACKET:
|
READPACKET:
|
||||||
INFO("TCP: data received %d bytes\r\n", len);
|
INFO("TCP: data received %d bytes\r\n", len);
|
||||||
if (len < MQTT_BUF_SIZE && len > 0) {
|
if (len < MQTT_BUF_SIZE && len > 0) {
|
||||||
|
@ -375,6 +376,8 @@ mqtt_tcpclient_sent_cb(void *arg)
|
||||||
MQTT_Client* client = (MQTT_Client *)pCon->reverse;
|
MQTT_Client* client = (MQTT_Client *)pCon->reverse;
|
||||||
INFO("TCP: Sent\r\n");
|
INFO("TCP: Sent\r\n");
|
||||||
client->sendTimeout = 0;
|
client->sendTimeout = 0;
|
||||||
|
client->keepAliveTick =0;
|
||||||
|
|
||||||
if ((client->connState == MQTT_DATA || client->connState == MQTT_KEEPALIVE_SEND)
|
if ((client->connState == MQTT_DATA || client->connState == MQTT_KEEPALIVE_SEND)
|
||||||
&& client->mqtt_state.pending_msg_type == MQTT_MSG_TYPE_PUBLISH) {
|
&& client->mqtt_state.pending_msg_type == MQTT_MSG_TYPE_PUBLISH) {
|
||||||
if (client->publishedCb)
|
if (client->publishedCb)
|
||||||
|
|
Ładowanie…
Reference in New Issue