1 /******************************************************************************
2 *
3 * Copyright (c) 2014 The Android Open Source Project
4 * Copyright (C) 2003-2012 Broadcom Corporation
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at:
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 ******************************************************************************/
19
20 #include "bta_hf_client_int.h"
21 #include "stdio.h"
22 #include "common/bt_target.h"
23
24 #if (BTA_HF_INCLUDED == TRUE)
25
bta_hf_client_send_at_cmd(tBTA_HF_CLIENT_DATA * p_data)26 void bta_hf_client_send_at_cmd(tBTA_HF_CLIENT_DATA *p_data)
27 {
28 tBTA_HF_CLIENT_DATA_VAL *p_val = (tBTA_HF_CLIENT_DATA_VAL *)p_data;
29
30 switch (p_val->uint8_val) {
31 case BTA_HF_CLIENT_AT_CMD_VTS:
32 bta_hf_client_send_at_vts((char)p_val->uint32_val1);
33 break;
34 case BTA_HF_CLIENT_AT_CMD_BTRH:
35 bta_hf_client_send_at_btrh(FALSE, p_val->uint32_val1);
36 break;
37 case BTA_HF_CLIENT_AT_CMD_CHUP:
38 bta_hf_client_send_at_chup();
39 break;
40 case BTA_HF_CLIENT_AT_CMD_CHLD:
41 /* expects ascii code for command */
42 bta_hf_client_send_at_chld('0' + p_val->uint32_val1, p_val->uint32_val2);
43 break;
44 case BTA_HF_CLIENT_AT_CMD_BCC:
45 bta_hf_client_send_at_bcc();
46 break;
47 case BTA_HF_CLIENT_AT_CMD_CNUM:
48 bta_hf_client_send_at_cnum();
49 break;
50 case BTA_HF_CLIENT_AT_CMD_ATA:
51 bta_hf_client_send_at_ata();
52 break;
53 case BTA_HF_CLIENT_AT_CMD_COPS:
54 bta_hf_client_send_at_cops(TRUE);
55 break;
56 case BTA_HF_CLIENT_AT_CMD_ATD:
57 bta_hf_client_send_at_atd(p_val->str, p_val->uint32_val1);
58 break;
59 case BTA_HF_CLIENT_AT_CMD_VGM:
60 bta_hf_client_send_at_vgm(p_val->uint32_val1);
61 break;
62 case BTA_HF_CLIENT_AT_CMD_VGS:
63 bta_hf_client_send_at_vgs(p_val->uint32_val1);
64 break;
65 case BTA_HF_CLIENT_AT_CMD_BVRA:
66 bta_hf_client_send_at_bvra(p_val->uint32_val1 == 0 ? FALSE : TRUE);
67 break;
68 case BTA_HF_CLIENT_AT_CMD_CLCC:
69 bta_hf_client_send_at_clcc();
70 break;
71 case BTA_HF_CLIENT_AT_CMD_BINP:
72 bta_hf_client_send_at_binp(p_val->uint32_val1);
73 break;
74 case BTA_HF_CLIENT_AT_CMD_BLDN:
75 bta_hf_client_send_at_bldn();
76 break;
77 case BTA_HF_CLIENT_AT_CMD_NREC:
78 bta_hf_client_send_at_nrec();
79 break;
80 case BTA_HF_CLIENT_AT_CMD_XAPL:
81 bta_hf_client_send_at_xapl(p_val->str, p_val->uint32_val1);
82 break;
83 case BTA_HF_CLIENT_AT_CMD_IPHONEACCEV:
84 bta_hf_client_send_at_iphoneaccev(p_val->uint32_val1, p_val->uint32_val1 == 0 ? FALSE : TRUE);
85 break;
86 default:
87 APPL_TRACE_ERROR("Default case, %s", __FUNCTION__);
88 break;
89 }
90 }
91 #endif /* #if (BTA_HF_INCLUDED == TRUE) */
92