init_wifi.c 656 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022/01/20 bernard the first version
  9. */
  10. #include <stdint.h>
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <rtthread.h>
  14. #ifdef PKG_USING_RW007
  15. #define WIFI_SH_PATH "/sd/wifi.sh"
  16. int rw007_wifi_init(void)
  17. {
  18. if (access(WIFI_SH_PATH, 0) != -1)
  19. {
  20. msh_exec(WIFI_SH_PATH, rt_strlen(WIFI_SH_PATH));
  21. }
  22. else
  23. {
  24. rt_kprintf("%s wi-fi configuration file not exist in sd card!\n", WIFI_SH_PATH);
  25. }
  26. return 0;
  27. }
  28. INIT_APP_EXPORT(rw007_wifi_init);
  29. #endif