]> granicus.if.org Git - esp-idf/blob - components/bt/host/bluedroid/api/include/api/esp_hf_defs.h
Merge branch 'feature/move_supplicant_to_idf_new' into 'master'
[esp-idf] / components / bt / host / bluedroid / api / include / api / esp_hf_defs.h
1 // Copyright 2018 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef __ESP_HF_DEFS_H__
16 #define __ESP_HF_DEFS_H__
17
18 #include "esp_bt_defs.h"
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24
25 /// Bluetooth HFP audio volume control target
26 typedef enum {
27     ESP_HF_VOLUME_CONTROL_TARGET_SPK = 0,             /*!< speaker */
28     ESP_HF_VOLUME_CONTROL_TARGET_MIC,                 /*!< microphone */
29 } esp_hf_volume_control_target_t;
30
31 /// +CIND roaming status indicator values
32 typedef enum {
33     ESP_HF_ROAMING_STATUS_INACTIVE = 0,               /*!< roaming is not active */
34     ESP_HF_ROAMING_STATUS_ACTIVE,                     /*!< a roaming is active */
35 } esp_hf_roaming_status_t;
36
37 /// +CIND call status indicator values
38 typedef enum {
39     ESP_HF_CALL_STATUS_NO_CALLS = 0,                  /*!< no call in progress  */
40     ESP_HF_CALL_STATUS_CALL_IN_PROGRESS = 1,          /*!< call is present(active or held) */
41 } esp_hf_call_status_t;
42
43 /// +CIND call setup status indicator values
44 typedef enum {
45     ESP_HF_CALL_SETUP_STATUS_NONE = 0,                /*!< no call setup in progress */
46     ESP_HF_CALL_SETUP_STATUS_INCOMING = 1,            /*!< incoming call setup in progress */
47     ESP_HF_CALL_SETUP_STATUS_OUTGOING_DIALING = 2,    /*!< outgoing call setup in dialing state */
48     ESP_HF_CALL_SETUP_STATUS_OUTGOING_ALERTING = 3,   /*!< outgoing call setup in alerting state */
49 } esp_hf_call_setup_status_t;
50
51 /// +CIND call held indicator values
52 typedef enum {
53     ESP_HF_CALL_HELD_STATUS_NONE = 0,                 /*!< no calls held */
54     ESP_HF_CALL_HELD_STATUS_HELD_AND_ACTIVE = 1,      /*!< both active and held call */
55     ESP_HF_CALL_HELD_STATUS_HELD = 2,                 /*!< call on hold, no active call*/
56 } esp_hf_call_held_status_t;
57
58 /// +CIND network service availability status
59 typedef enum {
60     ESP_HF_SERVICE_AVAILABILITY_STATUS_UNAVAILABLE = 0, /*!< service not available */
61     ESP_HF_SERVICE_AVAILABILITY_STATUS_AVAILABLE,       /*!< service available */
62 } esp_hf_service_availability_status_t;
63
64 /// +CLCC status of the call
65 typedef enum {
66     ESP_HF_CURRENT_CALL_STATUS_ACTIVE = 0,            /*!< active */
67     ESP_HF_CURRENT_CALL_STATUS_HELD = 1,              /*!< held */
68     ESP_HF_CURRENT_CALL_STATUS_DIALING = 2,           /*!< dialing (outgoing calls only) */
69     ESP_HF_CURRENT_CALL_STATUS_ALERTING = 3,          /*!< alerting (outgoing calls only) */
70     ESP_HF_CURRENT_CALL_STATUS_INCOMING = 4,          /*!< incoming (incoming calls only) */
71     ESP_HF_CURRENT_CALL_STATUS_WAITING = 5,           /*!< waiting (incoming calls only) */
72     ESP_HF_CURRENT_CALL_STATUS_HELD_BY_RESP_HOLD = 6, /*!< call held by response and hold */
73 } esp_hf_current_call_status_t;
74
75 /// +CLCC direction of the call
76 typedef enum {
77     ESP_HF_CURRENT_CALL_DIRECTION_OUTGOING = 0,       /*!< outgoing */
78     ESP_HF_CURRENT_CALL_DIRECTION_INCOMING = 1,       /*!< incoming */
79 } esp_hf_current_call_direction_t;
80
81 /// +CLCC multi-party call flag
82 typedef enum {
83     ESP_HF_CURRENT_CALL_MPTY_TYPE_SINGLE = 0,         /*!< not a member of a multi-party call */
84     ESP_HF_CURRENT_CALL_MPTY_TYPE_MULTI = 1,          /*!< member of a multi-party call */
85 } esp_hf_current_call_mpty_type_t;
86
87 /// +CLCC call mode
88 typedef enum {
89     ESP_HF_CURRENT_CALL_MODE_VOICE = 0,
90     ESP_HF_CURRENT_CALL_MODE_DATA = 1,
91     ESP_HF_CURRENT_CALL_MODE_FAX = 2,
92 } esp_hf_current_call_mode_t;
93
94 /// +CLCC address type
95 typedef enum {
96     ESP_HF_CALL_ADDR_TYPE_UNKNOWN = 0x81,            /*!< unkown address type */
97     ESP_HF_CALL_ADDR_TYPE_INTERNATIONAL = 0x91,      /*!< international address */
98 } esp_hf_call_addr_type_t;
99
100 /// +CNUM service type of the phone number
101 typedef enum {
102     ESP_HF_SUBSCRIBER_SERVICE_TYPE_UNKNOWN = 0,      /*!< unknown */
103     ESP_HF_SUBSCRIBER_SERVICE_TYPE_VOICE,            /*!< voice service */
104     ESP_HF_SUBSCRIBER_SERVICE_TYPE_FAX,              /*!< fax service */
105 } esp_hf_subscriber_service_type_t;
106
107 /// +BTRH response and hold result code
108 typedef enum {
109     ESP_HF_BTRH_STATUS_HELD = 0,       /*!< incoming call is put on held in AG */
110     ESP_HF_BTRH_STATUS_ACCEPTED,       /*!< held incoming call is accepted in AG */
111     ESP_HF_BTRH_STATUS_REJECTED,       /*!< held incoming call is rejected in AG */
112 } esp_hf_btrh_status_t;
113
114 /// AT+BTRH response and hold action code
115 typedef enum {
116     ESP_HF_BTRH_CMD_HOLD = 0,          /*!< put the incoming call on hold */
117     ESP_HF_BTRH_CMD_ACCEPT = 1,        /*!< accept a held incoming call */
118     ESP_HF_BTRH_CMD_REJECT = 2,        /*!< reject a held incoming call */
119 } esp_hf_btrh_cmd_t;
120
121 /// response indication codes for AT commands
122 typedef enum {
123     ESP_HF_AT_RESPONSE_CODE_OK = 0,         /*!< acknowledges execution of a command line */
124     ESP_HF_AT_RESPONSE_CODE_ERR,            /*!< command not accepted */
125     ESP_HF_AT_RESPONSE_CODE_NO_CARRIER,     /*!< connection terminated */
126     ESP_HF_AT_RESPONSE_CODE_BUSY,           /*!< busy signal detected */
127     ESP_HF_AT_RESPONSE_CODE_NO_ANSWER,      /*!< connection completion timeout */
128     ESP_HF_AT_RESPONSE_CODE_DELAYED,        /*!< delayed */
129     ESP_HF_AT_RESPONSE_CODE_BLACKLISTED,    /*!< blacklisted */
130     ESP_HF_AT_RESPONSE_CODE_CME,            /*!< CME error */
131 } esp_hf_at_response_code_t;
132
133 /// voice recognition state
134 typedef enum {
135     ESP_HF_VR_STATE_DISABLED = 0,           /*!< voice recognition disabled */
136     ESP_HF_VR_STATE_ENABLED,                /*!< voice recognition enabled */
137 } esp_hf_vr_state_t;
138
139 /// AT+CHLD command values
140 typedef enum {
141     ESP_HF_CHLD_TYPE_REL = 0,               /*!< <0>, Terminate all held or set UDUB("busy") to a waiting call */
142     ESP_HF_CHLD_TYPE_REL_ACC,               /*!< <1>, Terminate all active calls and accepts a waiting/held call */
143     ESP_HF_CHLD_TYPE_HOLD_ACC,              /*!< <2>, Hold all active calls and accepts a waiting/held call */
144     ESP_HF_CHLD_TYPE_MERGE,                 /*!< <3>, Add all held calls to a conference */
145     ESP_HF_CHLD_TYPE_MERGE_DETACH,          /*!< <4>, connect the two calls and disconnects the subscriber from both calls */
146     ESP_HF_CHLD_TYPE_REL_X,                 /*!< <1x>, releases specified calls only */
147     ESP_HF_CHLD_TYPE_PRIV_X,                /*!< <2x>, request private consultation mode with specified call */
148 } esp_hf_chld_type_t;
149
150 /// Extended Audio Gateway Error Result Code Response
151 typedef enum {
152     ESP_HF_CME_AG_FAILURE = 0,                    /*!< ag failure */
153     ESP_HF_CME_NO_CONNECTION_TO_PHONE = 1,        /*!< no connection to phone */
154     ESP_HF_CME_OPERATION_NOT_ALLOWED = 3,         /*!< operation not allowed */
155     ESP_HF_CME_OPERATION_NOT_SUPPORTED = 4,       /*!< operation not supported */
156     ESP_HF_CME_PH_SIM_PIN_REQUIRED = 5,           /*!< PH-SIM PIN Required */
157     ESP_HF_CME_SIM_NOT_INSERTED = 10,             /*!< SIM not inserted */
158     ESP_HF_CME_SIM_PIN_REQUIRED = 11,             /*!< SIM PIN required */
159     ESP_HF_CME_SIM_PUK_REQUIRED = 12,             /*!< SIM PUK required */
160     ESP_HF_CME_SIM_FAILURE = 13,                  /*!< SIM failure */
161     ESP_HF_CME_SIM_BUSY = 14,                     /*!< SIM busy */
162     ESP_HF_CME_INCORRECT_PASSWORD = 16,           /*!< incorrect password */
163     ESP_HF_CME_SIM_PIN2_REQUIRED = 17,            /*!< SIM PIN2 required */
164     ESP_HF_CME_SIM_PUK2_REQUIRED = 18,            /*!< SIM PUK2 required */
165     ESP_HF_CME_MEMEORY_FULL = 20,                 /*!< memory full */
166     ESP_HF_CME_INVALID_INDEX = 21,                /*!< invalid index */
167     ESP_HF_CME_MEMEORY_FAILURE = 23,              /*!< memory failure */
168     ESP_HF_CME_TEXT_STRING_TOO_LONG = 24,         /*!< test string too long */
169     ESP_HF_CME_INVALID_CHARACTERS_IN_TEXT_STRING = 25,  /*!< invalid characters in text string */
170     ESP_HF_CME_DIAL_STRING_TOO_LONG = 26,         /*!< dial string too long*/
171     ESP_HF_CME_INVALID_CHARACTERS_IN_DIAL_STRING = 27,  /*!< invalid characters in dial string */
172     ESP_HF_CME_NO_NETWORK_SERVICE = 30,           /*!< no network service */
173     ESP_HF_CME_NETWORK_TIMEOUT = 31,              /*!< network timeout */
174     ESP_HF_CME_NETWORK_NOT_ALLOWED = 32,          /*!< network not allowed --emergency calls only */
175 } esp_hf_cme_err_t;
176
177 #ifdef __cplusplus
178 }
179 #endif
180
181 #endif /* __ESP_HF_DEFS_H__ */