#include <RbootHttpUpdater.h>

Inheritance diagram for RbootHttpUpdater:
[legend]
Collaboration diagram for RbootHttpUpdater:
[legend]

Public Member Functions

virtual ~RbootHttpUpdater ()
 
bool addItem (int offset, const String &firmwareFileUrl, size_t maxSize=0)
 
bool addItem (const String &firmwareFileUrl, RbootOutputStream *stream=nullptr)
 
void start ()
 
void switchToRom (uint8_t romSlot)
 
void setCallback (OtaUpdateDelegate reqUpdateDelegate)
 
void setDelegate (OtaUpdateDelegate reqUpdateDelegate)
 
void setBaseRequest (HttpRequest *request)
 
RbootHttpUpdaterItem getItem (unsigned int index)
 

Protected Types

typedef ObjectMap< String, HttpClientConnectionHttpConnectionPool
 

Protected Member Functions

void applyUpdate ()
 
void updateFailed ()
 
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)
 
HttpRequestcreateRequest (const Url &url)
 Helper function to create a new request on a URL. More...
 
String getCacheKey (const Url &url)
 

Protected Attributes

Vector< RbootHttpUpdaterItemitems
 
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 Typedef Documentation

◆ HttpConnectionPool

Constructor & Destructor Documentation

◆ ~RbootHttpUpdater()

virtual RbootHttpUpdater::~RbootHttpUpdater ( )
inlinevirtual

Member Function Documentation

◆ addItem() [1/2]

bool RbootHttpUpdater::addItem ( int  offset,
const String firmwareFileUrl,
size_t  maxSize = 0 
)

◆ addItem() [2/2]

bool RbootHttpUpdater::addItem ( const String firmwareFileUrl,
RbootOutputStream stream = nullptr 
)

◆ applyUpdate()

void RbootHttpUpdater::applyUpdate ( )
protected

◆ createRequest()

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

Helper function to create a new request on a URL.

Parameters
url
Return values
HttpRequest*

◆ downloadFile() [1/2]

bool HttpClient::downloadFile ( const Url url,
RequestCompletedDelegate  requestComplete = nullptr 
)
inlineinherited

◆ downloadFile() [2/2]

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

◆ downloadString()

bool HttpClient::downloadString ( const Url url,
RequestCompletedDelegate  requestComplete 
)
inlineinherited

◆ getCacheKey()

String HttpClient::getCacheKey ( const Url url)
inlineprotectedinherited

◆ getItem()

RbootHttpUpdaterItem RbootHttpUpdater::getItem ( unsigned int  index)
inline

◆ itemComplete()

virtual int RbootHttpUpdater::itemComplete ( HttpConnection client,
bool  success 
)
protectedvirtual

◆ request()

HttpRequest* HttpClient::request ( const String url)
inlineinherited

◆ send()

bool HttpClient::send ( HttpRequest request)
inherited

◆ sendRequest() [1/3]

bool HttpClient::sendRequest ( const Url url,
RequestCompletedDelegate  requestComplete 
)
inlineinherited

◆ sendRequest() [2/3]

bool HttpClient::sendRequest ( const HttpMethod  method,
const Url url,
const HttpHeaders headers,
RequestCompletedDelegate  requestComplete 
)
inlineinherited

◆ sendRequest() [3/3]

bool HttpClient::sendRequest ( const HttpMethod  method,
const Url url,
const HttpHeaders headers,
const String body,
RequestCompletedDelegate  requestComplete 
)
inlineinherited

◆ setBaseRequest()

void RbootHttpUpdater::setBaseRequest ( HttpRequest request)
inline

◆ setCallback()

void RbootHttpUpdater::setCallback ( OtaUpdateDelegate  reqUpdateDelegate)
inline

◆ setDelegate()

void RbootHttpUpdater::setDelegate ( OtaUpdateDelegate  reqUpdateDelegate)
inline

◆ start()

void RbootHttpUpdater::start ( )

◆ switchToRom()

void RbootHttpUpdater::switchToRom ( uint8_t  romSlot)
inline

◆ updateComplete()

virtual int RbootHttpUpdater::updateComplete ( HttpConnection client,
bool  success 
)
protectedvirtual

◆ updateFailed()

void RbootHttpUpdater::updateFailed ( )
protected

Member Data Documentation

◆ baseRequest

HttpRequest* RbootHttpUpdater::baseRequest = nullptr
protected

◆ currentItem

int RbootHttpUpdater::currentItem = 0
protected

◆ httpConnectionPool

HttpConnectionPool HttpClient::httpConnectionPool
staticprotectedinherited

◆ items

Vector<RbootHttpUpdaterItem> RbootHttpUpdater::items
protected

◆ rbootWriteStatus

rboot_write_status RbootHttpUpdater::rbootWriteStatus
protected

◆ romSlot

uint8_t RbootHttpUpdater::romSlot = NO_ROM_SWITCH
protected

◆ updateDelegate

OtaUpdateDelegate RbootHttpUpdater::updateDelegate = nullptr
protected

The documentation for this class was generated from the following file: