cmd_ota.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Console example — various system commands
  2. This example code is in the Public Domain (or CC0 licensed, at your option.)
  3. Unless required by applicable law or agreed to in writing, this
  4. software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  5. CONDITIONS OF ANY KIND, either express or implied.
  6. */
  7. #include "../squeezelite-ota/cmd_ota.h"
  8. #include <stdio.h>
  9. #include <string.h>
  10. #include <ctype.h>
  11. #include "esp_log.h"
  12. #include "esp_console.h"
  13. #include "esp_system.h"
  14. #include "esp_sleep.h"
  15. #include "esp_spi_flash.h"
  16. #include "driver/rtc_io.h"
  17. #include "driver/uart.h"
  18. #include "argtable3/argtable3.h"
  19. #include "freertos/FreeRTOS.h"
  20. #include "freertos/task.h"
  21. #include "soc/rtc_cntl_reg.h"
  22. #include "esp32/rom/uart.h"
  23. #include "sdkconfig.h"
  24. static const char * TAG = "platform_esp32";
  25. /* 'heap' command prints minumum heap size */
  26. static int perform_ota_update(int argc, char **argv)
  27. {
  28. return 0;
  29. }
  30. static void register_ota_cmd()
  31. {
  32. const esp_console_cmd_t cmd = {
  33. .command = "ota_update",
  34. .help = "Updates the application binary from the provided URL",
  35. .hint = NULL,
  36. .func = &perform_ota_update,
  37. };
  38. ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
  39. }