#ifndef NL_OTA_H #define NL_OTA_H #include void nl_ota_init(void); /* Starts a download task for an http:// URL. 0 = started, -1 = busy or invalid. */ int nl_ota_start(const char *url); /* Same, but for the boot recovery path (spec 8.3): an image whose trailer carries the running * firmware version is rejected instead of flashed. The rescue station stays up while a whole * batch of lamps migrates, so without this check every boot would re-flash the same image * forever. A deliberate re-flash of the same version stays possible over the REST API. */ int nl_ota_start_recovery(const char *url); bool nl_ota_busy(void); /* True when the last recovery attempt deliberately skipped an image whose version already matches the running firmware - that is not a failure and sets no last_ota_error. */ bool nl_ota_skipped(void); /* NULL, or one of: download, crc, trailer, device_mismatch, hash, busy */ const char *nl_ota_last_error(void); void nl_ota_set_error(const char *e); #endif