recovery.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "application_name.h"
  4. #include "esp_err.h"
  5. #include "esp_app_format.h"
  6. #include "cJSON.h"
  7. #include "stdbool.h"
  8. extern esp_err_t process_recovery_ota(const char * bin_url, char * bin_buffer, uint32_t length);
  9. extern cJSON * gpio_list;
  10. const __attribute__((section(".rodata_desc"))) esp_app_desc_t esp_app_desc = {
  11. .magic_word = ESP_APP_DESC_MAGIC_WORD,
  12. .version = PROJECT_VER,
  13. .project_name = CONFIG_PROJECT_NAME,
  14. .idf_ver = IDF_VER,
  15. #ifdef CONFIG_BOOTLOADER_APP_SECURE_VERSION
  16. .secure_version = CONFIG_BOOTLOADER_APP_SECURE_VERSION,
  17. #else
  18. .secure_version = 0,
  19. #endif
  20. #ifdef CONFIG_APP_COMPILE_TIME_DATE
  21. .time = __TIME__,
  22. .date = __DATE__,
  23. #else
  24. .time = "",
  25. .date = "",
  26. #endif
  27. };
  28. cJSON * get_gpio_list(bool refresh){
  29. if(!gpio_list){
  30. gpio_list = cJSON_CreateArray();
  31. }
  32. return gpio_list;
  33. }
  34. void register_optional_cmd(void) {
  35. }
  36. int main(int argc, char **argv){
  37. return 1;
  38. }
  39. void register_squeezelite(){
  40. }
  41. void register_external(void) {
  42. }
  43. void deregister_external(void) {
  44. }
  45. void decode_restore(int external) {
  46. }
  47. esp_err_t start_ota(const char * bin_url, char * bin_buffer, uint32_t length)
  48. {
  49. return process_recovery_ota(bin_url,bin_buffer,length);
  50. }