Skip to content

Commit d37b613

Browse files
committed
feat(hosted): Add hostedActivateUpdate() function
1 parent 99e010c commit d37b613

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

cores/esp32/esp32-hal-hosted.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,19 @@ bool hostedEndUpdate() {
132132
return err == ESP_OK;
133133
}
134134

135+
bool hostedActivateUpdate() {
136+
esp_err_t err = esp_hosted_slave_ota_activate();
137+
if (err != ESP_OK) {
138+
log_e("Failed to activate Update: %s", esp_err_to_name(err));
139+
}
140+
// else {
141+
// hostedDeinit();
142+
// delay(1000);
143+
// hostedInit();
144+
// }
145+
return err == ESP_OK;
146+
}
147+
135148
static bool hostedInit() {
136149
if (!hosted_initialized) {
137150
log_i("Initializing ESP-Hosted");

cores/esp32/esp32-hal-hosted.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ char * hostedGetUpdateURL();
5151
bool hostedBeginUpdate();
5252
bool hostedWriteUpdate(uint8_t* buf, uint32_t len);
5353
bool hostedEndUpdate();
54+
bool hostedActivateUpdate();
5455

5556
#ifdef __cplusplus
5657
}

0 commit comments

Comments
 (0)