quec_at_engine.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /** @file
  2. quec_at_engine.h
  3. @brief
  4. This file is used to define at command engine functions for different Quectel Project.
  5. */
  6. /*================================================================
  7. Copyright (c) 2021 Quectel Wireless Solution, Co., Ltd.
  8. All Rights Reserved.
  9. Quectel Wireless Solution Proprietary and Confidential.
  10. =================================================================*/
  11. /*=================================================================
  12. EDIT HISTORY FOR MODULE
  13. This section contains comments describing changes made to the module.
  14. Notice that changes are listed in reverse chronological order.
  15. WHEN WHO WHAT, WHERE, WHY
  16. ------------ ------- -------------------------------------------------------------------------------
  17. ------------ ------- -------------------------------------------------------------------------------
  18. =================================================================*/
  19. #ifndef QUEC_AT_ENGINE_H
  20. #define QUEC_AT_ENGINE_H
  21. #include "at_cfg.h"
  22. #include "quec_proj_config.h"
  23. #include "ql_uart_internal.h"
  24. #include "quec_at_param.h"
  25. #include "quec_atresp.h"
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /*************************************************************************
  30. * Macro
  31. **************************************************************************/
  32. #define QUEC_AT_CONFIG_ALL_CHANNEL 1
  33. #define QUEC_AT_VIRT_PORT_CNT 10
  34. #define QUEC_VIRT_AT_PIPE_LEN 1024
  35. extern atSetting_t gAtSetting;
  36. /*========================================================================
  37. * general Definition
  38. *========================================================================*/
  39. #define QUEC_ATC_S3 gAtSetting.chsetting.s3
  40. #define QUEC_ATC_S4 gAtSetting.chsetting.s4
  41. #define QUEC_ATC_ATV gAtSetting.chsetting.atv
  42. #define QUEC_ATC_ATQ gAtSetting.chsetting.atq
  43. #define QUEC_ATC_ATE gAtSetting.chsetting.ate
  44. #define QUEC_ATC_CMEE gAtSetting.chsetting.cmee
  45. #define QUEC_ATC_CRC gAtSetting.chsetting.crc
  46. #define QUEC_CHAR_CR QUEC_ATC_S3
  47. #define QUEC_CHAR_LF QUEC_ATC_S4
  48. #define QUEC_CHAR_BACKSPACE 0x8
  49. #define QUEC_CHAR_DOT ','
  50. #define QUEC_CHAR_QUOT '"'
  51. #define QUEC_CHAR_EQUA '='
  52. #define QUEC_CHAR_QUES '?'
  53. #define QUEC_CHAR_AND '&'
  54. #define QUEC_CHAR_END '\0'
  55. #define QUEC_CHAR_SEMI ';'
  56. #define QUEC_CHAR_SPACE ' '
  57. #define QUEC_CHAR_BRACE_LEFT '{'
  58. #define QUEC_CHAR_BRACE_RIGHT '}'
  59. #define AT_EXTENDED_PREFIXES "+*$%^"
  60. #define AT_BASIC_PREFIXES "adehilmoqvwxz" //这些AT均只有一个字节的名称,且只有一个参数,参数为AT_BASIC_PARAM_SUPPORT中支持的值
  61. #define AT_BASIC_PARAM_RANGE "0123456789*#" //基础型AT所支持的非字母参数
  62. #define AT_BASIC_PARAM_CK(chr) (strchr(AT_BASIC_PARAM_RANGE, chr) || (isalpha(chr) && !strchr(AT_BASIC_PREFIXES,tolower(chr))))
  63. typedef enum
  64. {
  65. QUEC_AT_REAL_PORT_MIN = 0,
  66. QUEC_AT_REAL_PORT_MAX = DEV_MAX,
  67. QUEC_AT_VIRT_PORT_MIN,
  68. QUEC_AT_VIRT_PORT_MAX = QUEC_AT_VIRT_PORT_MIN + QUEC_AT_VIRT_PORT_CNT, //虚拟通道
  69. QUEC_AT_PORT_MAX
  70. }quec_at_port_e;
  71. typedef enum
  72. {
  73. QUEC_CHSETTING_CRC = 0,
  74. QUEC_CHSETTING_CHSETTING,
  75. QUEC_CHSETTING_CMEE,
  76. QUEC_CHSETTING_ATE,
  77. QUEC_CHSETTING_ATV,
  78. QUEC_CHSETTING_ATQ,
  79. QUEC_CHSETTING_ATX,
  80. QUEC_CHSETTING_S3,
  81. QUEC_CHSETTING_S4,
  82. QUEC_CHSETTING_S5,
  83. QUEC_CHSETTING_ANDD,
  84. QUEC_CHSETTING_ANDC,
  85. }quec_at_chsetting_e;
  86. /*************************************************************************
  87. * Enum
  88. **************************************************************************/
  89. /*************************************************************************
  90. * Struct
  91. **************************************************************************/
  92. void quec_at_set_all_chsetting(quec_at_chsetting_e type, void *data, int len);
  93. void quec_app_at_add(const ql_at_desc_t *desc, size_t list_length);
  94. atChannelSetting_t *quec_at_get_chsetting(void);
  95. #ifdef __cplusplus
  96. } /*"C" */
  97. #endif
  98. #endif /* QUEC_AT_ENGINE_H */