Improve Switch OTA flow with download progress and clearer error screens.

This commit is contained in:
Andrew Quenehen
2026-08-06 07:54:28 -03:00
parent 1bfc89fdd4
commit dc04a4e848
6 changed files with 321 additions and 70 deletions
+5 -2
View File
@@ -7,13 +7,16 @@
extern "C" {
#endif
/* fraction is 0..1 when Content-Length is known, else -1 for indeterminate. */
typedef void (*ota_net_progress_fn)(void *userdata, double fraction);
/* Download URL into memory buffer (caller frees *out). Returns 0 on success. */
int ota_net_download_buffer(const char *url, long timeout_ms, char **out, size_t *out_len,
char *err, size_t err_len);
/* Download URL to a filesystem path. Returns 0 on success. */
/* Download URL to a filesystem path. progress may be NULL. Returns 0 on success. */
int ota_net_download_file(const char *url, const char *path, long timeout_ms, char *err,
size_t err_len);
size_t err_len, ota_net_progress_fn progress, void *progress_ud);
#ifdef __cplusplus
}
@@ -20,6 +20,10 @@ void ota_ui_show_progress(const char *title, const char *detail, float progress0
/* Error / info + wait for B. */
void ota_ui_alert(const char *title, const char *line1, const char *line2);
/* User-friendly error with optional technical detail and installed-version footer. */
void ota_ui_alert_error(const char *title, const char *friendly, const char *technical,
const char *installed_version);
/* Missing game install screen; wait for +. */
void ota_ui_missing_game(void);