at_sample_esp8266.c 962 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. * 2019-05-10 chenyong first version
  9. */
  10. #include <at_device_esp8266.h>
  11. #define LOG_TAG "at.sample.esp"
  12. #include <at_log.h>
  13. #define ESP8266_SAMPLE_DEIVCE_NAME "esp0"
  14. static struct at_device_esp8266 esp0 =
  15. {
  16. ESP8266_SAMPLE_DEIVCE_NAME,
  17. ESP8266_SAMPLE_CLIENT_NAME,
  18. ESP8266_SAMPLE_WIFI_SSID,
  19. ESP8266_SAMPLE_WIFI_PASSWORD,
  20. ESP8266_SAMPLE_RECV_BUFF_LEN,
  21. };
  22. static int esp8266_device_register(void)
  23. {
  24. struct at_device_esp8266 *esp8266 = &esp0;
  25. return at_device_register(&(esp8266->device),
  26. esp8266->device_name,
  27. esp8266->client_name,
  28. AT_DEVICE_CLASS_ESP8266,
  29. (void *) esp8266);
  30. }
  31. INIT_APP_EXPORT(esp8266_device_register);