Added new WEB API end point which will later be used to perform OTA Updates
This commit is contained in:
parent
306bb3a932
commit
9247d261cf
@ -557,3 +557,26 @@ boolean ioSetModeApi(WEBServer<WEBClient>::HttpRequestData &HRD, WiFiClient *wc,
|
||||
wc->print(buffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean otaUpdateApi(WEBServer<WEBClient>::HttpRequestData &HRD, WiFiClient *wc, void *pData)
|
||||
{
|
||||
Serial.printf("OTA Update resquest\n");
|
||||
|
||||
char buffer[500];
|
||||
size_t read(0);
|
||||
|
||||
while(wc->available())
|
||||
{
|
||||
read = wc->read(buffer, 500);
|
||||
for(uint8_t i(0); i < read; i++)
|
||||
Serial.printf("%02X %s",buffer[i], i % 30 == 0 ? "\n" : "");
|
||||
|
||||
yield();
|
||||
}
|
||||
|
||||
WEBServer<WEBClient>::sendHTTPHeader(wc, HttpConstants::httpMIMETypeToString(HttpConstants::TEXT_PLAIN), 2);
|
||||
wc->print("OK");
|
||||
//wc->peekBuffer
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -30,5 +30,6 @@ boolean ioGetLevelApi(WEBServer<WEBClient>::HttpRequestData&, WiFiClient*, void*
|
||||
boolean ioSetLevelApi(WEBServer<WEBClient>::HttpRequestData&, WiFiClient*, void*);
|
||||
boolean ioGetModeApi(WEBServer<WEBClient>::HttpRequestData&, WiFiClient*, void*);
|
||||
boolean ioSetModeApi(WEBServer<WEBClient>::HttpRequestData&, WiFiClient*, void*);
|
||||
boolean otaUpdateApi(WEBServer<WEBClient>::HttpRequestData&, WiFiClient*, void*);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user