cert_test.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include "nvs_flash.h"
  7. #include "esp_console.h"
  8. #include "cmd_system.h"
  9. #include "cmd_phy.h"
  10. #include "esp_phy_cert_test.h"
  11. void app_main(void)
  12. {
  13. ESP_ERROR_CHECK(nvs_flash_init());
  14. esp_console_repl_t *repl = NULL;
  15. esp_console_repl_config_t repl_config = ESP_CONSOLE_REPL_CONFIG_DEFAULT();
  16. repl_config.prompt = "phy>";
  17. #if CONFIG_ESP_CONSOLE_UART
  18. esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
  19. ESP_ERROR_CHECK(esp_console_new_repl_uart(&uart_config, &repl_config, &repl));
  20. #elif CONFIG_ESP_CONSOLE_USB_CDC
  21. esp_console_dev_usb_cdc_config_t cdc_config = ESP_CONSOLE_DEV_CDC_CONFIG_DEFAULT();
  22. ESP_ERROR_CHECK(esp_console_new_repl_usb_cdc(&cdc_config, &repl_config, &repl));
  23. #elif CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
  24. esp_console_dev_usb_serial_jtag_config_t usbjtag_config = ESP_CONSOLE_DEV_USB_SERIAL_JTAG_CONFIG_DEFAULT();
  25. ESP_ERROR_CHECK(esp_console_new_repl_usb_serial_jtag(&usbjtag_config, &repl_config, &repl));
  26. #endif
  27. /* Register commands */
  28. register_system();
  29. #if CONFIG_ESP_PHY_ENABLE_CERT_TEST
  30. register_phy_cmd();
  31. /* rftest.a requirements */
  32. esp_wifi_power_domain_on();
  33. esp_phy_rftest_config(1);
  34. esp_phy_rftest_init();
  35. #endif
  36. printf("\n ==================================================\n");
  37. printf(" | RF certification test |\n");
  38. printf(" | |\n");
  39. printf(" | 1. Print 'help' to gain overview of commands |\n");
  40. printf(" | 2. Wi-Fi certification test |\n");
  41. printf(" | 3. Bluetooth certification test |\n");
  42. printf(" | |\n");
  43. printf(" =================================================\n\n");
  44. ESP_ERROR_CHECK(esp_console_start_repl(repl));
  45. }