File tree Expand file tree Collapse file tree 4 files changed +23
-36
lines changed Expand file tree Collapse file tree 4 files changed +23
-36
lines changed Original file line number Diff line number Diff line change @@ -31,19 +31,6 @@ extern "C" {
3131#endif 
3232
3333ArduinoOTAClass::ArduinoOTAClass ()
34- : _port(0 )
35- , _udp_ota(0 )
36- , _initialized(false )
37- , _rebootOnSuccess(true )
38- , _useMDNS(true )
39- , _state(OTA_IDLE)
40- , _size(0 )
41- , _cmd(0 )
42- , _ota_port(0 )
43- , _start_callback(NULL )
44- , _end_callback(NULL )
45- , _error_callback(NULL )
46- , _progress_callback(NULL )
4734{
4835}
4936
Original file line number Diff line number Diff line change @@ -69,31 +69,31 @@ class ArduinoOTAClass
6969    int  getCommand ();
7070
7171  private: 
72-     int  _port;
72+     void  _runUpdate (void );
73+     void  _onRx (void );
74+     int  parseInt (void );
75+     String readStringUntil (char  end);
76+ 
77+     int  _port = 0 ;
7378    String _password;
7479    String _hostname;
7580    String _nonce;
76-     UdpContext *_udp_ota;
77-     bool  _initialized;
78-     bool  _rebootOnSuccess;
79-     bool  _useMDNS;
80-     ota_state_t  _state;
81-     int  _size;
82-     int  _cmd;
83-     uint16_t  _ota_port;
84-     uint16_t  _ota_udp_port;
81+     UdpContext *_udp_ota =  nullptr ;
82+     bool  _initialized =  false ;
83+     bool  _rebootOnSuccess =  true ;
84+     bool  _useMDNS =  true ;
85+     ota_state_t  _state = OTA_IDLE ;
86+     int  _size =  0 ;
87+     int  _cmd =  0 ;
88+     uint16_t  _ota_port =  0 ;
89+     uint16_t  _ota_udp_port =  0 ;
8590    IPAddress _ota_ip;
8691    String _md5;
8792
88-     THandlerFunction _start_callback;
89-     THandlerFunction _end_callback;
90-     THandlerFunction_Error _error_callback;
91-     THandlerFunction_Progress _progress_callback;
92- 
93-     void  _runUpdate (void );
94-     void  _onRx (void );
95-     int  parseInt (void );
96-     String readStringUntil (char  end);
93+     THandlerFunction _start_callback = nullptr ;
94+     THandlerFunction _end_callback = nullptr ;
95+     THandlerFunction_Error _error_callback = nullptr ;
96+     THandlerFunction_Progress _progress_callback = nullptr ;
9797};
9898
9999#if  !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_ARDUINOOTA)
Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ extern "C" uint32_t _FS_start;
3030extern  " C" uint32_t  _FS_end;
3131
3232ESP8266HTTPUpdate::ESP8266HTTPUpdate (void )
33-         : _httpClientTimeout(8000 ), _followRedirects(HTTPC_DISABLE_FOLLOW_REDIRECTS), _ledPin(- 1 ) 
33+         : _httpClientTimeout(8000 )
3434{
3535}
3636
3737ESP8266HTTPUpdate::ESP8266HTTPUpdate (int  httpClientTimeout)
38-         : _httpClientTimeout(httpClientTimeout), _followRedirects(HTTPC_DISABLE_FOLLOW_REDIRECTS), _ledPin(- 1 ) 
38+         : _httpClientTimeout(httpClientTimeout)
3939{
4040}
4141
Original file line number Diff line number Diff line change @@ -184,15 +184,15 @@ class ESP8266HTTPUpdate
184184
185185private: 
186186    int  _httpClientTimeout;
187-     followRedirects_t _followRedirects;
187+     followRedirects_t _followRedirects = HTTPC_DISABLE_FOLLOW_REDIRECTS ;
188188
189189    //  Callbacks
190190    HTTPUpdateStartCB    _cbStart;
191191    HTTPUpdateEndCB      _cbEnd;
192192    HTTPUpdateErrorCB    _cbError;
193193    HTTPUpdateProgressCB _cbProgress;
194194
195-     int  _ledPin;
195+     int  _ledPin = - 1 ;
196196    uint8_t  _ledOn;
197197};
198198
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments