@@ -88,7 +88,6 @@ static void zblue_on_ct_passthrough_rsp(struct bt_avrcp_ct* ct, uint8_t tid, bt_
8888static void zblue_on_ct_notification_rsp (struct bt_avrcp_ct * ct , uint8_t tid , uint8_t status , uint8_t event_id , struct bt_avrcp_event_data * data );
8989static void zblue_on_ct_get_element_attrs_rsp (struct bt_avrcp_ct * ct , uint8_t tid , uint8_t status , struct net_buf * buf );
9090static void zblue_on_ct_get_play_status_rsp (struct bt_avrcp_ct * ct , uint8_t tid , uint8_t status , struct net_buf * buf );
91- static bt_status_t avrcp_control_disconnect (bt_controller_id_t id , bt_address_t * bd_addr , void * user_data );
9291#endif
9392
9493#ifdef CONFIG_BLUETOOTH_AVRCP_ABSOLUTE_VOLUME
@@ -147,6 +146,8 @@ static struct bt_avrcp_tg_cb avrcp_tg_cbks = {
147146};
148147#endif /* CONFIG_BLUETOOTH_AVRCP_TARGET || CONFIG_BLUETOOTH_AVRCP_ABSOLUTE_VOLUME */
149148
149+ static bt_status_t bt_sal_avrcp_disconnect (bt_controller_id_t id , bt_address_t * bd_addr , void * user_data );
150+
150151#ifdef AVRCP_SDP_BY_APP
151152#if defined(CONFIG_BLUETOOTH_AVRCP_CONTROL ) || defined(CONFIG_BLUETOOTH_AVRCP_ABSOLUTE_VOLUME )
152153static struct bt_sdp_attribute avrcp_ct_attrs [] = {
@@ -733,7 +734,7 @@ static void zblue_on_ct_connected(struct bt_conn* conn, struct bt_avrcp_ct* ct)
733734 msg -> data .conn_state .reason = PROFILE_REASON_UNSPECIFIED ;
734735 bt_sal_avrcp_control_event_callback (msg );
735736 bt_sal_cm_profile_connected_callback (& avrcp_info -> bd_addr , PROFILE_AVRCP_CT , CONN_ID_DEFAULT );
736- bt_sal_profile_disconnect_register (& avrcp_info -> bd_addr , PROFILE_AVRCP_CT , CONN_ID_DEFAULT , PRIMARY_ADAPTER , avrcp_control_disconnect , NULL );
737+ bt_sal_profile_disconnect_register (& avrcp_info -> bd_addr , PROFILE_AVRCP_CT , CONN_ID_DEFAULT , PRIMARY_ADAPTER , bt_sal_avrcp_disconnect , NULL );
737738}
738739
739740static void zblue_on_ct_disconnected (struct bt_avrcp_ct * ct )
@@ -1052,6 +1053,9 @@ static void zblue_on_tg_connected(struct bt_conn* conn, struct bt_avrcp_tg* tg)
10521053 msg -> data .conn_state .conn_state = PROFILE_STATE_CONNECTED ;
10531054 msg -> data .conn_state .reason = PROFILE_REASON_UNSPECIFIED ;
10541055 bt_sal_avrcp_target_event_callback (msg );
1056+
1057+ bt_sal_cm_profile_connected_callback (& avrcp_info -> bd_addr , PROFILE_AVRCP_TG , CONN_ID_DEFAULT );
1058+ bt_sal_profile_disconnect_register (& avrcp_info -> bd_addr , PROFILE_AVRCP_TG , CONN_ID_DEFAULT , PRIMARY_ADAPTER , bt_sal_avrcp_disconnect , NULL );
10551059#endif
10561060}
10571061
@@ -1073,6 +1077,8 @@ static void zblue_on_tg_disconnected(struct bt_avrcp_tg* tg)
10731077 msg -> data .conn_state .conn_state = PROFILE_STATE_DISCONNECTED ;
10741078 msg -> data .conn_state .reason = PROFILE_REASON_UNSPECIFIED ;
10751079 bt_sal_avrcp_target_event_callback (msg );
1080+
1081+ bt_sal_cm_profile_disconnected_callback (& avrcp_info -> bd_addr , PROFILE_AVRCP_TG , CONN_ID_DEFAULT );
10761082#endif
10771083
10781084 bt_list_remove_avrcp_info (avrcp_info );
@@ -1416,8 +1422,7 @@ bt_status_t bt_sal_avrcp_control_connect(bt_controller_id_t id, bt_address_t* ad
14161422#endif
14171423}
14181424
1419- #ifdef CONFIG_BLUETOOTH_AVRCP_CONTROL
1420- static bt_status_t avrcp_control_disconnect (bt_controller_id_t id , bt_address_t * bd_addr , void * user_data )
1425+ static bt_status_t bt_sal_avrcp_disconnect (bt_controller_id_t id , bt_address_t * bd_addr , void * user_data )
14211426{
14221427 zblue_avrcp_info_t * avrcp_info ;
14231428 int err ;
@@ -1444,12 +1449,11 @@ static bt_status_t avrcp_control_disconnect(bt_controller_id_t id, bt_address_t*
14441449 bt_list_remove (bt_avrcp_conn , avrcp_info );
14451450 return BT_STATUS_FAIL ;
14461451}
1447- #endif
14481452
14491453bt_status_t bt_sal_avrcp_control_disconnect (bt_controller_id_t id , bt_address_t * addr )
14501454{
14511455#ifdef CONFIG_BLUETOOTH_AVRCP_CONTROL
1452- return bt_sal_profile_disconnect_request (addr , PROFILE_AVRCP_CT , CONN_ID_DEFAULT , id , avrcp_control_disconnect , NULL );
1456+ return bt_sal_profile_disconnect_request (addr , PROFILE_AVRCP_CT , CONN_ID_DEFAULT , id , bt_sal_avrcp_disconnect , NULL );
14531457#else
14541458 return BT_STATUS_NOT_SUPPORTED ;
14551459#endif
0 commit comments