1 /******************************************************************************
3 * Copyright (c) 2014 The Android Open Source Project
4 * Copyright (C) 2003-2012 Broadcom Corporation
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:
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 ******************************************************************************/
20 #include "bta_hf_client_int.h"
23 void bta_hf_client_send_at_cmd(tBTA_HF_CLIENT_DATA *p_data)
25 tBTA_HF_CLIENT_DATA_VAL *p_val = (tBTA_HF_CLIENT_DATA_VAL *)p_data;
26 char buf[BTA_HF_CLIENT_AT_MAX_LEN];
28 switch(p_val->uint8_val)
30 case BTA_HF_CLIENT_AT_CMD_VTS:
31 bta_hf_client_send_at_vts((char)p_val->uint32_val1);
33 case BTA_HF_CLIENT_AT_CMD_BTRH:
34 bta_hf_client_send_at_btrh(FALSE, p_val->uint32_val1);
36 case BTA_HF_CLIENT_AT_CMD_CHUP:
37 bta_hf_client_send_at_chup();
39 case BTA_HF_CLIENT_AT_CMD_CHLD:
40 /* expects ascii code for command */
41 bta_hf_client_send_at_chld('0' + p_val->uint32_val1, p_val->uint32_val2);
43 case BTA_HF_CLIENT_AT_CMD_BCC:
44 bta_hf_client_send_at_bcc();
46 case BTA_HF_CLIENT_AT_CMD_CNUM:
47 bta_hf_client_send_at_cnum();
49 case BTA_HF_CLIENT_AT_CMD_ATA:
50 bta_hf_client_send_at_ata();
52 case BTA_HF_CLIENT_AT_CMD_COPS:
53 bta_hf_client_send_at_cops(TRUE);
55 case BTA_HF_CLIENT_AT_CMD_ATD:
56 bta_hf_client_send_at_atd(p_val->str, p_val->uint32_val1);
58 case BTA_HF_CLIENT_AT_CMD_VGM:
59 bta_hf_client_send_at_vgm(p_val->uint32_val1);
61 case BTA_HF_CLIENT_AT_CMD_VGS:
62 bta_hf_client_send_at_vgs(p_val->uint32_val1);
64 case BTA_HF_CLIENT_AT_CMD_BVRA:
65 bta_hf_client_send_at_bvra(p_val->uint32_val1 == 0 ? FALSE : TRUE);
67 case BTA_HF_CLIENT_AT_CMD_CLCC:
68 bta_hf_client_send_at_clcc();
70 case BTA_HF_CLIENT_AT_CMD_BINP:
71 bta_hf_client_send_at_binp(p_val->uint32_val1);
73 case BTA_HF_CLIENT_AT_CMD_BLDN:
74 bta_hf_client_send_at_bldn();
76 case BTA_HF_CLIENT_AT_CMD_NREC:
77 bta_hf_client_send_at_nrec();
80 APPL_TRACE_ERROR("Default case");
81 snprintf(buf,BTA_HF_CLIENT_AT_MAX_LEN,
82 "Cmd %d 1st arg %u 2nd arg %u string arg %s",
83 p_val->uint8_val, p_val->uint32_val1,
84 p_val->uint32_val2, p_val->str);
85 APPL_TRACE_ERROR("%s ", buf);