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 _CS_ADP_API_H_ 16 #define _CS_ADP_API_H_ 17 /*chipsea_ohos proguard begin*/ 18 #include "cs_proguard.h" 19 /*chipsea_ohos proguard end*/ 20 #include "cs_target_config.h" 21 #include "cs_adp_type.h" 22 23 #include "cs_adp_mgr.h" 24 #include "cs_adp_a2dp.h" 25 #include "cs_adp_avrcp.h" 26 #include "cs_adp_dev.h" 27 #include "cs_adp_hfp.h" 28 #include "cs_adp_hsp.h" 29 #include "cs_adp_spp.h" 30 #include "cs_adp_hid.h" 31 #include "cs_adp_test.h" 32 #include "cs_adp_tws.h" 33 #include "flash_api.h" 34 #include "cs_host_cfg.h" 35 36 void cs_stack_loop(void); 37 void cs_stack_init(cs_host_cfg_t cfg); 38 void cs_adp_mgr_init(void); 39 void cs_adp_register_app_msg_handle(cs_bt_msg_module module,app_msg_handle_cb callback); 40 41 APP_BT_MGR *cs_adp_get_app_bt_mgr_ptr(void); 42 void cs_adp_send_generate_key(void); 43 void cs_adp_set_lp_level(uint8_t level); 44 Status_BTDef cs_adp_inquiry_cancel(void); 45 Status_BTDef cs_adp_inquiry(U8 len, U8 maxResp); 46 Status_BTDef cs_adp_set_bt_name(const U8 *name, U8 length); 47 Status_BTDef cs_adp_sco_switch(uint16_t scohandle); 48 Status_BTDef cs_adp_role_switch(BT_ADDR bdaddr); 49 void cs_adp_disconnect_acl(BT_ADDR bdaddr); 50 Status_BTDef cs_adp_stop_sniff(BT_ADDR bdaddr); 51 Status_BTDef cs_adp_set_scan_mode(AppBtScanMode mode); 52 Status_BTDef cs_adp_set_linkpolicy(BT_ADDR bdaddr, AppBtLinkPolicy policy); 53 Status_BTDef cs_adp_set_sniff_timer(BT_ADDR bdaddr, AppBtSniffInfo* sniff_info,TimeT Time); 54 BOOL app_bt_check_invalid_bdaddr(BT_ADDR *bdaddr); 55 void cs_adp_save_flash(void); 56 void cs_adp_close_dev(void); 57 btdev_info* cs_adp_get_devinfo_by_addr(BT_ADDR *bdAddr); 58 uint8_t cs_adp_get_current_activeCons(void); 59 BOOL cs_adp_stack_config(void); 60 void cs_adp_erased_flash(void); 61 void cs_adp_send_hci_data_direct(const uint8_t *buff,uint8_t len); 62 APP_DEVLIST *cs_adp_get_a2dp_current_devinfo(void); 63 APP_DEVLIST *cs_adp_get_hfp_current_devinfo(void); 64 APP_DEVLIST *cs_adp_get_hsp_current_devinfo(void); 65 #if PLF_BLE_STACK && PLF_BLE_ONLY == 0 66 void cs_adp_rw_timer_notify(void); 67 #endif 68 void cs_change_host_log_level(BOOL flag,U32 level); 69 #endif 70