esp_hf_defs.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef __ESP_HF_DEFS_H__
  7. #define __ESP_HF_DEFS_H__
  8. #include "esp_bt_defs.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /// in-band ring tone state
  13. typedef enum {
  14. ESP_HF_IN_BAND_RINGTONE_NOT_PROVIDED = 0,
  15. ESP_HF_IN_BAND_RINGTONE_PROVIDED,
  16. } esp_hf_in_band_ring_state_t;
  17. /// voice recognition state
  18. typedef enum {
  19. ESP_HF_VR_STATE_DISABLED = 0, /*!< voice recognition disabled */
  20. ESP_HF_VR_STATE_ENABLED, /*!< voice recognition enabled */
  21. } esp_hf_vr_state_t;
  22. /// Bluetooth HFP audio volume control target
  23. typedef enum {
  24. ESP_HF_VOLUME_CONTROL_TARGET_SPK = 0, /*!< speaker */
  25. ESP_HF_VOLUME_CONTROL_TARGET_MIC, /*!< microphone */
  26. } esp_hf_volume_control_target_t;
  27. /// Bluetooth HFP audio connection status
  28. typedef enum {
  29. ESP_HF_AUDIO_STATE_DISCONNECTED = 0, /*!< audio connection released */
  30. ESP_HF_AUDIO_STATE_CONNECTING, /*!< audio connection has been initiated */
  31. ESP_HF_AUDIO_STATE_CONNECTED, /*!< audio connection is established */
  32. ESP_HF_AUDIO_STATE_CONNECTED_MSBC, /*!< mSBC audio connection is established */
  33. } esp_hf_audio_state_t;
  34. typedef enum {
  35. ESP_HF_VOLUME_TYPE_SPK = 0,
  36. ESP_HF_VOLUME_TYPE_MIC
  37. } esp_hf_volume_type_t;
  38. /// +CIND network service availability status
  39. typedef enum
  40. {
  41. ESP_HF_NETWORK_STATE_NOT_AVAILABLE = 0,
  42. ESP_HF_NETWORK_STATE_AVAILABLE
  43. } esp_hf_network_state_t;
  44. /** +CIEV Service type */
  45. typedef enum
  46. {
  47. ESP_HF_SERVICE_TYPE_HOME = 0,
  48. ESP_HF_SERVICE_TYPE_ROAMING
  49. } esp_hf_service_type_t;
  50. /// +CIND call status indicator values
  51. typedef enum {
  52. ESP_HF_CALL_STATUS_NO_CALLS = 0, /*!< no call in progress */
  53. ESP_HF_CALL_STATUS_CALL_IN_PROGRESS = 1, /*!< call is present(active or held) */
  54. } esp_hf_call_status_t;
  55. /// +CIND call setup status indicator values
  56. typedef enum {
  57. ESP_HF_CALL_SETUP_STATUS_IDLE = 0, /*!< no call setup in progress */
  58. ESP_HF_CALL_SETUP_STATUS_INCOMING = 1, /*!< incoming call setup in progress */
  59. ESP_HF_CALL_SETUP_STATUS_OUTGOING_DIALING = 2, /*!< outgoing call setup in dialing state */
  60. ESP_HF_CALL_SETUP_STATUS_OUTGOING_ALERTING = 3, /*!< outgoing call setup in alerting state */
  61. } esp_hf_call_setup_status_t;
  62. /// +CIND roaming status indicator values
  63. typedef enum {
  64. ESP_HF_ROAMING_STATUS_INACTIVE = 0, /*!< roaming is not active */
  65. ESP_HF_ROAMING_STATUS_ACTIVE, /*!< a roaming is active */
  66. } esp_hf_roaming_status_t;
  67. /// +CIND call held indicator values
  68. typedef enum {
  69. ESP_HF_CALL_HELD_STATUS_NONE = 0, /*!< no calls held */
  70. ESP_HF_CALL_HELD_STATUS_HELD_AND_ACTIVE = 1, /*!< both active and held call */
  71. ESP_HF_CALL_HELD_STATUS_HELD = 2, /*!< call on hold, no active call*/
  72. } esp_hf_call_held_status_t;
  73. /// +CLCC status of the call
  74. typedef enum {
  75. ESP_HF_CURRENT_CALL_STATUS_ACTIVE = 0, /*!< active */
  76. ESP_HF_CURRENT_CALL_STATUS_HELD = 1, /*!< held */
  77. ESP_HF_CURRENT_CALL_STATUS_DIALING = 2, /*!< dialing (outgoing calls only) */
  78. ESP_HF_CURRENT_CALL_STATUS_ALERTING = 3, /*!< alerting (outgoing calls only) */
  79. ESP_HF_CURRENT_CALL_STATUS_INCOMING = 4, /*!< incoming (incoming calls only) */
  80. ESP_HF_CURRENT_CALL_STATUS_WAITING = 5, /*!< waiting (incoming calls only) */
  81. ESP_HF_CURRENT_CALL_STATUS_HELD_BY_RESP_HOLD = 6, /*!< call held by response and hold */
  82. } esp_hf_current_call_status_t;
  83. /// +CLCC direction of the call
  84. typedef enum {
  85. ESP_HF_CURRENT_CALL_DIRECTION_OUTGOING = 0, /*!< outgoing */
  86. ESP_HF_CURRENT_CALL_DIRECTION_INCOMING = 1, /*!< incoming */
  87. } esp_hf_current_call_direction_t;
  88. /// +CLCC multi-party call flag
  89. typedef enum {
  90. ESP_HF_CURRENT_CALL_MPTY_TYPE_SINGLE = 0, /*!< not a member of a multi-party call */
  91. ESP_HF_CURRENT_CALL_MPTY_TYPE_MULTI = 1, /*!< member of a multi-party call */
  92. } esp_hf_current_call_mpty_type_t;
  93. /// +CLCC call mode
  94. typedef enum {
  95. ESP_HF_CURRENT_CALL_MODE_VOICE = 0,
  96. ESP_HF_CURRENT_CALL_MODE_DATA = 1,
  97. ESP_HF_CURRENT_CALL_MODE_FAX = 2,
  98. } esp_hf_current_call_mode_t;
  99. /// +CLCC address type
  100. typedef enum {
  101. ESP_HF_CALL_ADDR_TYPE_UNKNOWN = 0x81, /*!< unkown address type */
  102. ESP_HF_CALL_ADDR_TYPE_INTERNATIONAL = 0x91, /*!< international address */
  103. } esp_hf_call_addr_type_t;
  104. /// +CNUM service type of the phone number
  105. typedef enum {
  106. ESP_HF_SUBSCRIBER_SERVICE_TYPE_UNKNOWN = 0, /*!< unknown */
  107. ESP_HF_SUBSCRIBER_SERVICE_TYPE_VOICE, /*!< voice service */
  108. ESP_HF_SUBSCRIBER_SERVICE_TYPE_FAX, /*!< fax service */
  109. } esp_hf_subscriber_service_type_t;
  110. /// +BTRH response and hold result code
  111. typedef enum {
  112. ESP_HF_BTRH_STATUS_HELD = 0, /*!< incoming call is put on held in AG */
  113. ESP_HF_BTRH_STATUS_ACCEPTED, /*!< held incoming call is accepted in AG */
  114. ESP_HF_BTRH_STATUS_REJECTED, /*!< held incoming call is rejected in AG */
  115. } esp_hf_btrh_status_t;
  116. /// AT+BTRH response and hold action code
  117. typedef enum {
  118. ESP_HF_BTRH_CMD_HOLD = 0, /*!< put the incoming call on hold */
  119. ESP_HF_BTRH_CMD_ACCEPT = 1, /*!< accept a held incoming call */
  120. ESP_HF_BTRH_CMD_REJECT = 2, /*!< reject a held incoming call */
  121. } esp_hf_btrh_cmd_t;
  122. /* +NREC */
  123. typedef enum
  124. {
  125. ESP_HF_NREC_STOP = 0,
  126. ESP_HF_NREC_START
  127. } esp_hf_nrec_t;
  128. ///+CCWA resposne status
  129. typedef enum {
  130. ESP_HF_CALL_WAITING_INACTIVE,
  131. ESP_HF_CALL_WAITING_ACTIVE,
  132. } esp_hf_call_waiting_status_t;
  133. /* WBS codec setting */
  134. typedef enum
  135. {
  136. ESP_HF_WBS_NONE,
  137. ESP_HF_WBS_NO,
  138. ESP_HF_WBS_YES
  139. }esp_hf_wbs_config_t;
  140. /// Bluetooth HFP RFCOMM connection and service level connection status
  141. typedef enum {
  142. ESP_HF_CONNECTION_STATE_DISCONNECTED = 0, /*!< RFCOMM data link channel released */
  143. ESP_HF_CONNECTION_STATE_CONNECTING, /*!< connecting remote device on the RFCOMM data link*/
  144. ESP_HF_CONNECTION_STATE_CONNECTED, /*!< RFCOMM connection established */
  145. ESP_HF_CONNECTION_STATE_SLC_CONNECTED, /*!< service level connection established */
  146. ESP_HF_CONNECTION_STATE_DISCONNECTING, /*!< disconnecting with remote device on the RFCOMM data link*/
  147. } esp_hf_connection_state_t;
  148. /// AT+CHLD command values
  149. typedef enum {
  150. ESP_HF_CHLD_TYPE_REL = 0, /*!< <0>, Terminate all held or set UDUB("busy") to a waiting call */
  151. ESP_HF_CHLD_TYPE_REL_ACC, /*!< <1>, Terminate all active calls and accepts a waiting/held call */
  152. ESP_HF_CHLD_TYPE_HOLD_ACC, /*!< <2>, Hold all active calls and accepts a waiting/held call */
  153. ESP_HF_CHLD_TYPE_MERGE, /*!< <3>, Add all held calls to a conference */
  154. ESP_HF_CHLD_TYPE_MERGE_DETACH, /*!< <4>, connect the two calls and disconnects the subscriber from both calls */
  155. ESP_HF_CHLD_TYPE_REL_X, /*!< <1x>, releases specified calls only */
  156. ESP_HF_CHLD_TYPE_PRIV_X, /*!< <2x>, request private consultation mode with specified call */
  157. } esp_hf_chld_type_t;
  158. /* AT response code - OK/Error */
  159. typedef enum {
  160. ESP_HF_AT_RESPONSE_CODE_OK = 0, /*!< acknowledges execution of a command line */
  161. ESP_HF_AT_RESPONSE_CODE_ERR, /*!< command not accepted */
  162. ESP_HF_AT_RESPONSE_CODE_NO_CARRIER, /*!< connection terminated */
  163. ESP_HF_AT_RESPONSE_CODE_BUSY, /*!< busy signal detected */
  164. ESP_HF_AT_RESPONSE_CODE_NO_ANSWER, /*!< connection completion timeout */
  165. ESP_HF_AT_RESPONSE_CODE_DELAYED, /*!< delayed */
  166. ESP_HF_AT_RESPONSE_CODE_BLACKLISTED, /*!< blacklisted */
  167. ESP_HF_AT_RESPONSE_CODE_CME, /*!< CME error */
  168. } esp_hf_at_response_code_t;
  169. /* AT response code - OK/Error */
  170. typedef enum {
  171. ESP_HF_AT_RESPONSE_ERROR = 0,
  172. ESP_HF_AT_RESPONSE_OK
  173. } esp_hf_at_response_t;
  174. /// Extended Audio Gateway Error Result Code Response
  175. typedef enum {
  176. ESP_HF_CME_AG_FAILURE = 0, /*!< ag failure */
  177. ESP_HF_CME_NO_CONNECTION_TO_PHONE = 1, /*!< no connection to phone */
  178. ESP_HF_CME_OPERATION_NOT_ALLOWED = 3, /*!< operation not allowed */
  179. ESP_HF_CME_OPERATION_NOT_SUPPORTED = 4, /*!< operation not supported */
  180. ESP_HF_CME_PH_SIM_PIN_REQUIRED = 5, /*!< PH-SIM PIN Required */
  181. ESP_HF_CME_SIM_NOT_INSERTED = 10, /*!< SIM not inserted */
  182. ESP_HF_CME_SIM_PIN_REQUIRED = 11, /*!< SIM PIN required */
  183. ESP_HF_CME_SIM_PUK_REQUIRED = 12, /*!< SIM PUK required */
  184. ESP_HF_CME_SIM_FAILURE = 13, /*!< SIM failure */
  185. ESP_HF_CME_SIM_BUSY = 14, /*!< SIM busy */
  186. ESP_HF_CME_INCORRECT_PASSWORD = 16, /*!< incorrect password */
  187. ESP_HF_CME_SIM_PIN2_REQUIRED = 17, /*!< SIM PIN2 required */
  188. ESP_HF_CME_SIM_PUK2_REQUIRED = 18, /*!< SIM PUK2 required */
  189. ESP_HF_CME_MEMORY_FULL = 20, /*!< memory full */
  190. ESP_HF_CME_INVALID_INDEX = 21, /*!< invalid index */
  191. ESP_HF_CME_MEMORY_FAILURE = 23, /*!< memory failure */
  192. ESP_HF_CME_TEXT_STRING_TOO_LONG = 24, /*!< test string too long */
  193. ESP_HF_CME_INVALID_CHARACTERS_IN_TEXT_STRING = 25, /*!< invalid characters in text string */
  194. ESP_HF_CME_DIAL_STRING_TOO_LONG = 26, /*!< dial string too long*/
  195. ESP_HF_CME_INVALID_CHARACTERS_IN_DIAL_STRING = 27, /*!< invalid characters in dial string */
  196. ESP_HF_CME_NO_NETWORK_SERVICE = 30, /*!< no network service */
  197. ESP_HF_CME_NETWORK_TIMEOUT = 31, /*!< network timeout */
  198. ESP_HF_CME_NETWORK_NOT_ALLOWED = 32, /*!< network not allowed --emergency calls only */
  199. } esp_hf_cme_err_t;
  200. #ifdef __cplusplus
  201. }
  202. #endif
  203. #endif /* __ESP_HF_DEFS_H__ */