jeelabs / esp-link

esp8266 wifi-serial bridge, outbound TCP, and arduino/AVR/LPC/NXP programmer
Other
2.84k stars 723 forks source link

MQTT LWT / Subscribe #378

Open mr-sven opened 6 years ago

mr-sven commented 6 years ago

In the file mqtt/mqtt_cmd.c the commands for MQTTCMD_Lwt and MQTTCMD_Subscribe loads wrong command argument length: Line 96:

- cmdPopArg(&req, (uint8_t*)&client->connect_info.will_qos, 4);
+ cmdPopArg(&req, (uint8_t*)&client->connect_info.will_qos, sizeof(client->connect_info.will_qos));

Line 99:

- cmdPopArg(&req, (uint8_t*)&client->connect_info.will_retain, 4);
+ cmdPopArg(&req, (uint8_t*)&client->connect_info.will_retain, sizeof(client->connect_info.will_retain));

Line 180:

- cmdPopArg(&req, (uint8_t*)&qos, 4);
+ cmdPopArg(&req, (uint8_t*)&qos, sizeof(qos));

In MQTTCMD_Publish the values loaded correct using sizeof.

Regards Sven