at_sample_ec200x.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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-12-13 qiyongzhong first version
  9. */
  10. #include <at_device_ec200x.h>
  11. #define LOG_TAG "at.sample.ec200x"
  12. #include <at_log.h>
  13. #define EC200X_SAMPLE_DEIVCE_NAME "ec200x"
  14. static struct at_device_ec200x _dev =
  15. {
  16. EC200X_SAMPLE_DEIVCE_NAME,
  17. EC200X_SAMPLE_CLIENT_NAME,
  18. EC200X_SAMPLE_POWER_PIN,
  19. EC200X_SAMPLE_STATUS_PIN,
  20. EC200X_SAMPLE_WAKEUP_PIN,
  21. EC200X_SAMPLE_RECV_BUFF_LEN,
  22. RT_NULL
  23. };
  24. static int ec200x_device_register(void)
  25. {
  26. struct at_device_ec200x *ec200x = &_dev;
  27. return at_device_register(&(ec200x->device),
  28. ec200x->device_name,
  29. ec200x->client_name,
  30. AT_DEVICE_CLASS_EC200X,
  31. (void *) ec200x);
  32. }
  33. INIT_APP_EXPORT(ec200x_device_register);
  34. int ec200x_get_rssi(void)
  35. {
  36. struct at_device_ec200x *ec200x = &_dev;
  37. return(ec200x->rssi);
  38. }