File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,17 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
319319
320320ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected ()
321321{
322-   if  (!_mqttClient.connected () || !_thing.connected () || !_device.connected ())
322+ #if   OTA_ENABLED
323+   if (_get_ota_confirmation != nullptr  &&
324+       _ota.getState () == OTACloudProcessInterface::State::OtaAvailable &&
325+       _get_ota_confirmation ()) {
326+     _ota.approveOta ();
327+   }
328+ 
329+   _ota.update ();
330+ #endif  //  OTA_ENABLED
331+ 
332+   if  ((!_otaClient.connected ()) && (!_mqttClient.connected () || !_thing.connected () || !_device.connected ()))
323333  {
324334    return  State::Disconnect;
325335  }
@@ -338,16 +348,6 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected()
338348  /*  Call CloudDevice process to get configuration */ 
339349  _device.update ();
340350
341- #if   OTA_ENABLED
342-   if (_get_ota_confirmation != nullptr  &&
343-       _ota.getState () == OTACloudProcessInterface::State::OtaAvailable &&
344-       _get_ota_confirmation ()) {
345-     _ota.approveOta ();
346-   }
347- 
348-   _ota.update ();
349- #endif  //  OTA_ENABLED
350- 
351351
352352  if  (_device.isAttached ()) {
353353    /*  Call CloudThing process to synchronize properties */ 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments