1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Replace some manually managed buffers with Strings, fix code style

This commit is contained in:
Ivan Grokhotkov
2015-11-11 01:07:02 +03:00
parent 450718b4a4
commit 92069e657b
5 changed files with 188 additions and 167 deletions

View File

@ -23,26 +23,6 @@ typedef enum {
class ArduinoOTAClass
{
private:
int _port;
char *_password;
char * _hostname;
char * _nonce;
WiFiUDP* _udp_ota;
bool _initialized;
ota_state_t _state;
int _size, _cmd, _ota_port;
IPAddress _ota_ip;
char * _md5;
OTA_CALLBACK(_start_callback);
OTA_CALLBACK(_end_callback);
OTA_CALLBACK_ERROR(_error_callback);
OTA_CALLBACK_PROGRESS(_progress_callback);
void _runUpdate(void);
public:
ArduinoOTAClass();
~ArduinoOTAClass();
@ -55,6 +35,27 @@ class ArduinoOTAClass
void onError(OTA_CALLBACK_ERROR (fn));
void begin();
void handle();
private:
int _port;
String _password;
String _hostname;
String _nonce;
WiFiUDP _udp_ota;
bool _initialized;
ota_state_t _state;
int _size;
int _cmd;
int _ota_port;
IPAddress _ota_ip;
String _md5;
OTA_CALLBACK(_start_callback);
OTA_CALLBACK(_end_callback);
OTA_CALLBACK_ERROR(_error_callback);
OTA_CALLBACK_PROGRESS(_progress_callback);
void _runUpdate(void);
};
extern ArduinoOTAClass ArduinoOTA;