1 /* 2 * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved. 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 _APP_HFP_H_ 16 #define _APP_HFP_H_ 17 #if APP_SUPPORT_HFP == 1 18 19 20 typedef enum { 21 APP_IDLE, 22 APP_CONNECTED, 23 APP_CALL_INCOMING, 24 APP_CALL_OUTGOING, 25 APP_CALL_ACTIVE, 26 APP_VOICE_RECOGNITION, 27 APP_PLAY_SCO, 28 }app_hfp_state_t; 29 30 #define HF_SENDBUFF_SIZE (320) 31 #define HF_SENDBUFF_MEMPOOL_NUM (2) 32 33 typedef struct { 34 uint8_t buffer[HF_SENDBUFF_SIZE]; 35 uint16_t len; 36 }ScoSendData_t; 37 38 typedef struct { 39 ScoSendData_t mempool[HF_SENDBUFF_MEMPOOL_NUM]; 40 uint8_t idx; 41 } HF_SENDBUFF_T; 42 43 void app_set_hfp_state(app_hfp_state_t state); 44 app_hfp_state_t app_get_hfp_state(void); 45 void app_set_hfp_scocodec(uint16_t scocodec); 46 uint16_t app_get_hfp_scocodec(void); 47 void app_set_hfp_volume(BT_ADDR *bdaddr,S8 volume); 48 S8 app_get_hfp_volume(BT_ADDR *bdaddr); 49 BOOL app_hfp_key_handle(uint32_t key); 50 void app_hfp_msg_handle(CS_EVENT *event); 51 #endif 52 #endif 53