at_custom.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * custom_at.h
  3. *
  4. * This file is part of Espressif's AT+ command set program.
  5. * Copyright (C) 2013 - 2016, Espressif Systems
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of version 3 of the GNU General Public License as
  9. * published by the Free Software Foundation.
  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, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef CUSTOM_AT_H_
  20. #define CUSTOM_AT_H_
  21. #include "c_types.h"
  22. typedef struct
  23. {
  24. char *at_cmdName;
  25. int8_t at_cmdLen;
  26. void (*at_testCmd)(uint8_t id);
  27. void (*at_queryCmd)(uint8_t id);
  28. void (*at_setupCmd)(uint8_t id, char *pPara);
  29. void (*at_exeCmd)(uint8_t id);
  30. }at_funcationType;
  31. /**
  32. * @brief Response "OK" to uart.
  33. * @param None
  34. * @retval None
  35. */
  36. void at_response_ok(void);
  37. /**
  38. * @brief Response "ERROR" to uart.
  39. * @param events: no used
  40. * @retval None
  41. */
  42. void at_response_error(void);
  43. /**
  44. * @brief Task of process command or txdata.
  45. * @param custom_at_cmd_array: the array of at cmd that custom defined
  46. * cmd_num : the num of at cmd that custom defined
  47. * @retval None
  48. */
  49. void at_cmd_array_regist(at_funcationType *custom_at_cmd_array,uint32 cmd_num);
  50. /**
  51. * @brief get digit form at cmd line.the maybe alter pSrc
  52. * @param p_src: at cmd line string
  53. * result:the buffer to be placed result
  54. * err : err num
  55. * @retval TRUE:
  56. * FALSE:
  57. */
  58. bool at_get_next_int_dec(char **p_src,int*result,int* err);
  59. /**
  60. * @brief get string form at cmd line.the maybe alter pSrc
  61. * @param p_dest: the buffer to be placed result
  62. * p_src: at cmd line string
  63. * max_len :max len of string excepted to get
  64. * @retval None
  65. */
  66. int32 at_data_str_copy(char *p_dest, char **p_src, int32 max_len);
  67. /**
  68. * @brief initialize at module
  69. * @param None
  70. * @retval None
  71. */
  72. void at_init(void);
  73. /**
  74. * @brief print string to at port
  75. * @param string
  76. * @retval None
  77. */
  78. void at_port_print(const char *str);
  79. #endif