fix(aws_iot): Fix aws_iot handshake failed and exit

This commit is contained in:
Dong Heng
2018-08-09 11:39:04 +08:00
parent 1c36069ddd
commit 4fecc5344f
2 changed files with 2 additions and 2 deletions

View File

@ -271,7 +271,7 @@ void aws_iot_task(void *param) {
paramsQOS1.payload = (void *) cPayload;
paramsQOS1.isRetained = 0;
while((NETWORK_ATTEMPTING_RECONNECT == rc || NETWORK_RECONNECTED == rc || SUCCESS == rc)) {
while(1) {
//Max time the yield function will wait for read messages
rc = aws_iot_mqtt_yield(&client, 100);

View File

@ -289,7 +289,7 @@ void aws_iot_task(void *param) {
temperature = STARTING_ROOMTEMPERATURE;
// loop and publish a change in temperature
while(NETWORK_ATTEMPTING_RECONNECT == rc || NETWORK_RECONNECTED == rc || SUCCESS == rc) {
while(1) {
rc = aws_iot_shadow_yield(&mqttClient, 200);
if(NETWORK_ATTEMPTING_RECONNECT == rc || shadowUpdateInProgress) {
rc = aws_iot_shadow_yield(&mqttClient, 1000);