File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -570,27 +570,20 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeThingTopics()
570570 return State::SubscribeThingTopics;
571571 }
572572
573- if (_shadowTopicIn != " " )
573+ if (!_mqttClient. subscribe (_shadowTopicIn) )
574574 {
575- if (!_mqttClient.subscribe (_shadowTopicIn))
576- {
577- DEBUG_ERROR (" ArduinoIoTCloudTCP::%s could not subscribe to %s" , __FUNCTION__, _shadowTopicIn.c_str ());
575+ DEBUG_ERROR (" ArduinoIoTCloudTCP::%s could not subscribe to %s" , __FUNCTION__, _shadowTopicIn.c_str ());
578576#if !defined(__AVR__)
579- DEBUG_ERROR (" Check your thing configuration, and press the reset button on your board." );
577+ DEBUG_ERROR (" Check your thing configuration, and press the reset button on your board." );
580578#endif
581- return State::SubscribeThingTopics;
582- }
579+ return State::SubscribeThingTopics;
583580 }
584581
585582 DEBUG_INFO (" Connected to Arduino IoT Cloud" );
586583 execCloudEventCallback (ArduinoIoTCloudEvent::CONNECT);
587584 _deviceSubscribedToThing = true ;
588585
589- if (_shadowTopicIn != " " )
590- return State::RequestLastValues;
591- else
592- return State::Connected;
593-
586+ return State::RequestLastValues;
594587}
595588
596589ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_RequestLastValues ()
You can’t perform that action at this time.
0 commit comments