Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
rBootHttpUpdate Class Reference
Inheritance diagram for rBootHttpUpdate:
HttpClient

Public Member Functions

void addItem (int offset, String firmwareFileUrl)
 
void start ()
 
void switchToRom (uint8_t romSlot)
 
void setCallback (OtaUpdateDelegate reqUpdateDelegate)
 
void setDelegate (OtaUpdateDelegate reqUpdateDelegate)
 
void setBaseRequest (HttpRequest *request)
 
rBootHttpUpdateItem getItem (unsigned int index)
 

Protected Types

typedef ObjectMap< String, HttpClientConnectionHttpConnectionPool
 

Protected Member Functions

void applyUpdate ()
 
void updateFailed ()
 
virtual rBootItemOutputStreamgetStream ()
 
virtual int itemComplete (HttpConnection &client, bool success)
 
virtual int updateComplete (HttpConnection &client, bool success)
 
bool sendRequest (const Url &url, RequestCompletedDelegate requestComplete)
 
bool sendRequest (const HttpMethod method, const Url &url, const HttpHeaders &headers, RequestCompletedDelegate requestComplete)
 
bool sendRequest (const HttpMethod method, const Url &url, const HttpHeaders &headers, const String &body, RequestCompletedDelegate requestComplete)
 
bool downloadString (const Url &url, RequestCompletedDelegate requestComplete)
 
bool downloadFile (const Url &url, RequestCompletedDelegate requestComplete=nullptr)
 
bool downloadFile (const Url &url, const String &saveFileName, RequestCompletedDelegate requestComplete=nullptr)
 Queue request to download a file. More...
 
bool send (HttpRequest *request)
 
HttpRequestrequest (const String &url) SMING_DEPRECATED
 
HttpRequestcreateRequest (const Url &url)
 Helper function to create a new request on a URL. More...
 
String getCacheKey (const Url &url)
 

Static Protected Member Functions

static void cleanup ()
 

Protected Attributes

Vector< rBootHttpUpdateItemitems
 
int currentItem = 0
 
rboot_write_status rBootWriteStatus
 
uint8_t romSlot = NO_ROM_SWITCH
 
OtaUpdateDelegate updateDelegate = nullptr
 
HttpRequestbaseRequest = nullptr
 

Static Protected Attributes

static HttpConnectionPool httpConnectionPool
 

Member Function Documentation

static void HttpClient::cleanup ( )
inlinestaticinherited

Use this method to clean all request queues and object pools

HttpRequest* HttpClient::createRequest ( const Url url)
inlineinherited

Helper function to create a new request on a URL.

Parameters
url
Return values
HttpRequest*
bool HttpClient::downloadFile ( const Url url,
const String saveFileName,
RequestCompletedDelegate  requestComplete = nullptr 
)
inherited

Queue request to download a file.

Parameters
urlSource of file data
saveFilenamePath to save file to. Optional: specify nullptr to use name from url
requestCompleteCompletion callback
HttpRequest* HttpClient::request ( const String url)
inlineinherited