Skip to content

Commit 1f6dc8a

Browse files
committed
OTA: create fetchTime() and fetchChunk()
1 parent 51e6568 commit 1f6dc8a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/ota/interface/OTAInterfaceDefault.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::startOTA() {
9090
}
9191

9292
OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetch() {
93+
if(downloadTime > 0) {
94+
return fetchTime();
95+
} else {
96+
return fetchChunk();
97+
}
98+
}
99+
100+
OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetchChunk() {
101+
return OtaDownloadFail;
102+
}
103+
104+
OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetchTime() {
93105
OTACloudProcessInterface::State res = Fetch;
94106
int http_res = 0;
95107
uint32_t start = millis();

src/ota/interface/OTAInterfaceDefault.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class OTADefaultCloudProcessInterface: public OTACloudProcessInterface {
4343

4444
private:
4545
void parseOta(uint8_t* buffer, size_t bufLen);
46+
State fetchTime();
47+
State fetchChunk();
4648

4749
Client* client;
4850
HttpClient* http_client;

0 commit comments

Comments
 (0)