at_sample_sim800c.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-13 chenyong first version
  9. */
  10. #include <at_device_sim800c.h>
  11. #define LOG_TAG "at.sample.sim800"
  12. #include <at_log.h>
  13. #define SIM800C_SAMPLE_DEIVCE_NAME "sim0"
  14. static struct at_device_sim800c sim0 =
  15. {
  16. SIM800C_SAMPLE_DEIVCE_NAME,
  17. SIM800C_SAMPLE_CLIENT_NAME,
  18. SIM800C_SAMPLE_POWER_PIN,
  19. SIM800C_SAMPLE_STATUS_PIN,
  20. SIM800C_SAMPLE_RECV_BUFF_LEN,
  21. };
  22. static int sim800c_device_register(void)
  23. {
  24. struct at_device_sim800c *sim800c = &sim0;
  25. return at_device_register(&(sim800c->device),
  26. sim800c->device_name,
  27. sim800c->client_name,
  28. AT_DEVICE_CLASS_SIM800C,
  29. (void *) sim800c);
  30. }
  31. INIT_APP_EXPORT(sim800c_device_register);