at_device_sim800c.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * File : at_device_sim800c.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2019-05-16 chenyong first version
  23. */
  24. #ifndef __AT_DEVICE_SIM800C_H__
  25. #define __AT_DEVICE_SIM800C_H__
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #include <stdlib.h>
  30. #include <at_device.h>
  31. /* The maximum number of sockets supported by the sim800c device */
  32. #define AT_DEVICE_SIM800C_SOCKETS_NUM 6
  33. struct at_device_sim800c
  34. {
  35. char *device_name;
  36. char *client_name;
  37. int power_pin;
  38. int power_status_pin;
  39. size_t recv_line_num;
  40. struct at_device device;
  41. void *user_data;
  42. };
  43. #ifdef AT_USING_SOCKET
  44. /* sim800c device socket initialize */
  45. int sim800c_socket_init(struct at_device *device);
  46. /* sim800c device class socket register */
  47. int sim800c_socket_class_register(struct at_device_class *class);
  48. #endif /* AT_USING_SOCKET */
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif /* __AT_DEVICE_SIM800C_H__ */