pinebuds/services/bt_app/app_bqb_new_profile.cpp

239 lines
7.6 KiB
C++
Raw Normal View History

2022-08-15 04:20:27 -05:00
/***************************************************************************
*
* Copyright 2015-2019 BES.
* All rights reserved. All unpublished rights reserved.
*
* No part of this work may be used or reproduced in any form or by any
* means, or stored in a database or retrieval system, without prior written
* permission of BES.
*
* Use of this work is governed by a license granted by BES.
* This work contains confidential and proprietary information of
* BES. which is protected by copyright, trade secret,
* trademark and other intellectual property rights.
*
****************************************************************************/
#if defined(__BQB_PROFILE_TEST__) && defined(ENHANCED_STACK)
#include "app_key.h"
#include "bt_if.h"
#include "conmgr_api.h"
#include "hal_trace.h"
2022-08-15 04:20:27 -05:00
static bt_bdaddr_t pts_bt_addr = {{
#if 1
0x14, 0x71, 0xda, 0x7d, 0x1a, 0x00
#else
0x13, 0x71, 0xda, 0x7d, 0x1a, 0x00
#endif
}};
void A2dp_pts_Create_Avdtp_Signal_Channel(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!A2dp_pts_Create_Avdtp_Signal_Channel\n");
btif_pts_av_create_channel(&pts_bt_addr);
2022-08-15 04:20:27 -05:00
}
void A2dp_pts_set_sink_delay(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!A2dp_pts_set_sink_delay\n");
btif_pts_av_set_sink_delay();
2022-08-15 04:20:27 -05:00
}
void Avctp_pts_avrcp_connect(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Avctp_pts_avrcp_connect\n");
btif_pts_ar_connect(&pts_bt_addr);
2022-08-15 04:20:27 -05:00
}
void Avrcp_pts_volume_change_notify(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Avrcp_pts_volume_change_notify\n");
btif_pts_ar_volume_notify();
2022-08-15 04:20:27 -05:00
}
void Avrcp_pts_set_absolute_volume(APP_KEY_STATUS *status, void *param) {
TRACE(0, "app_avrcp_set_absolute_volume\n");
btif_pts_ar_set_absolute_volume();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_create_service_level_channel(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_create_service_level_channel\n");
btif_pts_hf_create_service_link(&pts_bt_addr);
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_disconnect_service_link(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_disconnect_service_link\n");
btif_pts_hf_disc_service_link();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_create_audio_link(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_create_audio_link\n");
btif_pts_hf_create_audio_link();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_enable_voice_recognition(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_enable_voice_recognition\n");
btif_pts_hf_vr_enable();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_disable_voice_recognition(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_disable_voice_recognition\n");
btif_pts_hf_vr_disable();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_list_current_calls(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_list_current_calls\n");
btif_pts_hf_list_current_calls();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_release_active_call_index2(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_release_active_call_index2\n");
btif_pts_hf_release_active_call_2();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_hold_active_call_index2(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_hold_active_call_index2\n");
btif_pts_hf_hold_active_call_2();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_release_active_call(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_release_active_call\n");
btif_pts_hf_release_active_call();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_hf_indicators_1(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_hf_indicators_1\n");
btif_pts_hf_send_ind_1();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_hf_indicators_2(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_hf_indicators_2\n");
btif_pts_hf_send_ind_2();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_hf_indicators_3(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_hf_indicators_3\n");
btif_pts_hf_send_ind_3();
2022-08-15 04:20:27 -05:00
}
void Hfp_pts_update_indicators_value(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!Hfp_pts_update_indicators_value\n");
btif_pts_hf_update_ind_value();
2022-08-15 04:20:27 -05:00
}
void rfcomm_pts_register_channel(APP_KEY_STATUS *status, void *param) {
TRACE(0, "rfcomm_pts_register_channel\n");
btif_pts_rfc_register_channel();
2022-08-15 04:20:27 -05:00
}
void rfcomm_pts_rfcomm_close(APP_KEY_STATUS *status, void *param) {
TRACE(0, "rfcomm_pts_rfcomm_close\n");
btif_pts_rfc_close();
2022-08-15 04:20:27 -05:00
}
void rfcomm_pts_rfcomm_close_dlci0(APP_KEY_STATUS *status, void *param) {
TRACE(0, "rfcomm_pts_rfcomm_close_dlci0\n");
btif_pts_rfc_close_dlci_0();
2022-08-15 04:20:27 -05:00
}
void rfcomm_pts_rfcomm_send_data(APP_KEY_STATUS *status, void *param) {
TRACE(0, "rfcomm_pts_rfcomm_send_data\n");
btif_pts_rfc_send_data();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_discover_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_discover_cmd\n");
btif_pts_av_send_discover();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_get_capability_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_get_capability_cmd\n");
btif_pts_av_send_getcap();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_set_configuration_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_set_configuration_cmd\n");
btif_pts_av_send_setconf();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_get_configuration_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_get_configuration_cmd\n");
btif_pts_av_send_getconf();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_reconfigure_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_reconfigure_cmd\n");
btif_pts_av_send_reconf();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_open_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_open_cmd\n");
btif_pts_av_send_open();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_close_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_close_cmd\n");
btif_pts_av_send_close();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_abort_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_abort_cmd\n");
btif_pts_av_send_abort();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_get_all_capability_cmd(APP_KEY_STATUS *status,
void *param) {
TRACE(0, "Avdtp_pts_send_get_all_capability_cmd\n");
btif_pts_av_send_getallcap();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_suspend_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_suspend_cmd\n");
btif_pts_av_send_suspend();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_send_start_cmd(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_send_start_cmd\n");
btif_pts_av_send_start();
2022-08-15 04:20:27 -05:00
}
void Avdtp_pts_create_media_channel(APP_KEY_STATUS *status, void *param) {
TRACE(0, "Avdtp_pts_create_media_channel\n");
btif_pts_av_create_media_channel();
2022-08-15 04:20:27 -05:00
}
void l2cap_pts_disconnect_channel(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!l2cap_pts_disconnect_channel\n");
btif_pts_l2c_disc_channel();
2022-08-15 04:20:27 -05:00
}
void l2cap_pts_send_data(APP_KEY_STATUS *status, void *param) {
TRACE(0, "!!!l2cap_pts_send_data\n");
btif_pts_l2c_send_data();
2022-08-15 04:20:27 -05:00
}
void pts_spp_client_init(void);
btif_cmgr_handler_t *pts_cmgr_handler;
2022-08-15 04:20:27 -05:00
bt_status_t btif_cmgr_create_data_link(btif_cmgr_handler_t *cmgr_handler,
bt_bdaddr_t *bd_addr);
2022-08-15 04:20:27 -05:00
bt_status_t btif_cmgr_register_handler(btif_cmgr_handler_t *cmgr_handler,
btif_cmgr_callback callback);
void pts_cmgr_callback(btif_cmgr_handler_t *cHandler, cmgr_event_t Event,
bt_status_t Status);
void spp_pts_client_open(APP_KEY_STATUS *status, void *param) {
TRACE(0, "spp_pts_client_open\n");
2022-08-15 04:20:27 -05:00
pts_cmgr_handler = btif_cmgr_handler_create();
btif_cmgr_register_handler(pts_cmgr_handler, pts_cmgr_callback);
pts_spp_client_init();
btif_cmgr_create_data_link(pts_cmgr_handler, &pts_bt_addr);
2022-08-15 04:20:27 -05:00
}
extern struct gap_bdaddr BLE_BdAddr;
extern "C" void pts_ble_addr_init(void);
extern "C" void appm_start_connecting(struct gap_bdaddr *ptBdAddr);
void ble_pts_appm_start_connecting(APP_KEY_STATUS *status, void *param) {
TRACE(0, "ble_pts_appm_start_connecting\n");
pts_ble_addr_init();
appm_start_connecting(&BLE_BdAddr);
2022-08-15 04:20:27 -05:00
}
#endif