/**********************************************************************
*
*   strong_symbol.c
*   Define the strong function of some WEAK functions in the library, and dynamically close the library code
***********************************************************************/
#include "include.h"

const bool cfg_bt_sniff_mode_dis = true;
//Whether BT AAC audio is supported
#if !BT_A2DP_AAC_AUDIO_EN
void aac_dec_init(void) {}
void aac_decode_init(void) {}
bool aac_dec_frame(void) {return false;}
bool aac_nor_dec_frame(void) {return false;};
bool aac_tws_dec_frame(void) {return false;};
void aac_cache_free_do(void) {}
size_t aac_cache_read_do(uint8_t *buf, uint max_size) {return 0;}
uint16_t tws_pack_aac(uint8_t *buf) {
    return 0;
}
AT(.com_text.aac.obuf)
void aac_fill_tws_obuf(void) {}
AT(.aacdec.text)
void aac_obuf_tws_cpy(void) {}
#else
void aac_decode_init_do(void);
bool aac_dec_frame_do(void);
void aac_cache_free_do(void);
size_t aac_cache_read_do(uint8_t *buf, uint max_size);
AT(.text.music.init.aac)
void aac_decode_init(void) {
    aac_decode_init_do();
}
AT(.aacdec.text)
bool aac_dec_frame(void) {
    return aac_dec_frame_do();
}
AT(.aacdec.text)
void aac_cache_free(void) {
#if BT_TWS_EN
    aac_cache_free_do();
#endif
}
AT(.aacdec.text)
size_t aac_cache_read(uint8_t *buf, uint max_size) {
#if BT_TWS_EN
    return aac_cache_read_do(buf, max_size);
#else
    return 0;
#endif
}
#endif

#if !BT_TWS_EN
void btstack_tws_init(void){}
void a2dp_play_init(void){}
AT(.bcom_text.sbc.play)
void a2dp_play_reset(void){}
AT(.bcom_text.sbc.play)
void a2dp_play_reset_do(void){}

AT(.bcom_text.sbc_cache)
bool a2dp_cache_fill(uint8_t *packet, uint16_t size) {
    return true;
}

AT(.bcom_text.sbc_cache)
uint8_t avdtp_fill_tws_buffer(u8 *ptr, uint len) {
    return 0;
}

AT(.bcom_text.sbc_cache)
uint8_t a2dp_cache_before_rx(uint8_t *data_ptr, uint16_t data_len) {
    return 0;
}

AT(.sbcdec.code)
void sbc_cache_free(void) {
}

AT(.sbcdec.code)
size_t sbc_cache_read(uint8_t **buf) {
    return 0;
}

AT(.com_text.bb.tws)
void bt_tws_ticks_isr(void) {
}

AT(.bcom_text.bb.btisr)
void bt_tws_ticks_instant(uint32_t clk_off, uint16_t bit_off) {
}

AT(.bcom_text.bb.btisr)
uint8_t tws_get_ticks_status(void) {
    return 0x80;
}

uint8_t bt_tws_set_spr(uint8_t index, uint spridx, uint32_t instant) {
    return 0;
}

AT(.bcom_text.sbc.play)
void tws_ticks_trigger(uint32_t ticks) {
}

AT(.bcom_text.sbc.play)
uint32_t tws_get_play_ticks(uint16_t seq_num, uint32_t duration) {
    return 0;
}

AT(.com_text.sbc.play)
void tws_trigger_isr(void) {
}

AT(.bcom_text.sbc.play)
bool tws_cache_is_empty(void) {
    return false;
}

AT(.bcom_text.sbc.play)
void sbc_cache_env_reset(void)
{
}

AT(.bcom_text.sbc.send)
void tws_send_pkt(void)
{
}

AT(.bcom_text.bb.btisr)
void bt_tws_ticks_next_instant(void) {}

AT(.bcom_text.lc.tws)
uint8_t tws_get_snoop_status(void) {
    return 0;
}
AT(.bcom_text.sbc.play)
void a2dp_set_play_ticks(uint32_t e_ticks, uint16_t seqn) {}
AT(.bcom_text.sbc.play)
bool a2dp_is_rx_stop(uint8_t index) { return false; }
AT(.bcom_text.a2dp.lost)
uint32_t a2dp_lost_get_cache(void) { return 0; }
AT(.bcom_text.sbc)
void tws_ticks_set(void) {}

AT(.bcom_text.bb.tws_switch)
bool bt_tws_need_switch(bool calling) { return false; }
AT(.bcom_text.bb.bttx)
bool tws_evs_rx_remote(u8 *buf) { return false; }
AT(.bcom_text.bb.bttx)
void tws_seqn_update_local(u32 e_ticks, uint16_t seqn, bool first) {}
AT(.bcom_text.sbc.play)
uint8_t avdtp_check_play_reset(void) { return 0; }
AT(.bcom_text.sbc.play)
size_t a2dp_play_read_do(uint8_t **buf) { return 0; }
AT(.bcom_text.sbc.play)
void a2dp_play_free_do(void) {}
AT(.bcom_text.sbc.play)
bool a2dp_fix_slv_ticks(u32 m_ticks, u16 m_seqn) { return false; }
AT(.bcom_text.sbc.play)
bool tws_is_first_pkt(void) { return false; }
uint16_t tws_set_snoop_ticks(uint8_t *data_ptr, uint16_t size) { return false; }
AT(.bcom_text.bb.btisr)
void bt_set_sync_tick(u32 clock) {}
AT(.bcom_text.bb.btisr)
bool bt_sync_tick(void) { return false; }
AT(.bcom_text.bb.btisr)
void bt_set_sync_info(u8 *buf) {}
#else
#endif


#if !BT_FCC_TEST_EN || !LE_EN
uint8_t vs_ble_test(void const *cmd) {
    return 0x11;
}
uint8_t ble_test_start(void* params) {
    return 0x0c;
}
uint8_t ble_test_stop(void) {
    return 0x0c;
}
#endif

#if BT_FCC_TEST_EN
#if LE_EN
uint8_t vs_ble_test_do(void const *cmd);
uint8_t vs_ble_test(void const *cmd) {
    return vs_ble_test_do(cmd);
}
#endif
bool bt_acl_test_rx_end_do(uint8_t index, void *par);
AT(.com_text.bt21.isr.test.fcc)
bool bt_acl_test_rx_end(uint8_t index, void *par) {
    return bt_acl_test_rx_end_do(index, par);
}
#else
uint8_t vs_fcc_test_cmd(void const *param) {
    return 0x11;
}
void huart_init(void)
{
}
AT(.com_text.stack.uart_isr)
bool bt_uart_isr(void) {
    return false;
}
#endif

#if !BT_HFP_REC_EN
AT(.com_text.bt_rec)
void bt_sco_rec_mix_do(u8 *buf, u32 samples) {}
void bt_sco_fill_remote_buf(u16 *buf, u16 samples) {}
#endif

#if !LE_EN
void ble_txpkt_init(void) {}
AT(.com_text.stack.ble.mtu)
u16 ble_get_gatt_mtu(void) { return 0; }
void btstack_ble_send_req(void) {}
int ble_send_notify_packet(void *context, void *buf) {return -1;}
void att_event_server_send(void) {}
//void hci_run_le_connection(void) {}
bool ble_event_cmd_complete(uint8_t *packet, int size) { return false; }
void ble_event_meta(uint8_t *packet, int size) {}
void btstack_ble_init(void) {}
void btstack_gatt_init(void) {}
void btstack_ble_update_conn_param(void) {}
void btstack_ble_set_adv_interval(void) {}

typedef uint8_t (*bb_msg_func_t)(uint16_t index, void const *param);
typedef uint8_t (*bb_cmd_func_t)(uint16_t cmd, void const *param);
typedef uint8_t (*ll_cntl_func_t)(uint8_t opcode);

struct ll_cntl_pdu_info
{
    ll_cntl_func_t  func;
    const char*     desc;
    uint16_t        length;
    uint8_t         flag;
};

struct bb_msg_info
{
    uint16_t index;
    bb_msg_func_t func;
};

struct bb_cmd_info
{
    uint16_t index;
    bb_cmd_func_t func;
};

AT(.rodata.le.ll_proc)
const struct bb_cmd_info ll_hci_cmd_tbl[1] = {0};
AT(.rodata.le.ll_proc)
const struct bb_msg_info ll_msg_tbl[1] = {0};
AT(.rodata.le.ll_cntl)
const struct ll_cntl_pdu_info ll_cntl_pdu_tbl[1] = {0};
AT(.rodata.le.ll_proc)
const struct bb_msg_info mgr_hci_cmd_tbl[1] = {0};
void ll_init(uint8_t init_type) {}
uint8_t ll_start(uint8_t index, void *param) {return -1;}
void ll_stop(uint8_t index) {}
void ll_cntl_state_set(uint8_t index, uint8_t txrx, uint8_t state) {}
void ll_proc_timer_set(uint8_t index, uint8_t type, bool enable) {}
void ll_proc_timer_set_state(uint8_t index, uint8_t type, bool enable) {}
void ll_cntl_send(uint8_t index, void *pdu, ll_cntl_func_t tx_func) {}
void ll_cntl_tx_check(uint8_t index) {}
bool ble_adv_end_con_ind(void const *param) { return false; }
void aes_init(uint8_t init_type) {};
void aes_result_handler(uint8_t status, uint8_t* result) {};
#endif

#if !BT_PBAP_EN
//void pbap_client_init(void) {}
//void goep_client_init(uint8_t rfcomm_channel_nr) {}
void btstack_pbap(u8 param) {}
#endif

#if FOT_EN
u8 is_fot_update_en(void)
{
    return 1;
}
#endif

#if !CHARGE_CTRL_EN
void bsp_charge_ctrl_process(void) {};
#endif

#if !FUNC_USBDEV_EN
void usb_init(void){}
void usb_isr(void){}
void usb_dev_isr(void){}
void ude_ep_reset(void){}
void ude_control_flow(void){}
void ude_isoc_tx_process(void){}
void ude_isoc_rx_process(void){}
void lock_code_usbdev(void){}
void unlock_code_usbdev(void){}
#endif //FUNC_USBDEV_EN

//wav
#if !DAC_EN
u8 dac_get_max_anl_vol(void)
{
    return 0;
}
#endif
AT(.com_text.dac)
void dac_set_mute_callback(u8 mute_flag){}
AT(.text.bsp.dac)
void bsp_dac_sta_set(u8 sta){}
