4 * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Nilesh Trimbake <t.shripati@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #include <sys/socket.h>
23 #include <sys/errno.h>
28 #include "oal-hardware.h"
29 #include "oal-device-mgr.h"
30 #include <oal-manager.h>
31 #include <oal-avrcp-ct.h>
33 #include <bt-service-avrcp-ctrl.h>
34 #include <bluetooth-media-control.h>
35 #include <bt-service-event.h>
37 static int __media_prop_to_oal_type(int type)
43 oal_type = OAL_EQUALIZER;
46 oal_type = OAL_SHUFFLE;
49 oal_type = OAL_REPEAT;
55 oal_type = OAL_PLAY_POSITION;
58 oal_type = OAL_PLAY_STATUS;
61 BT_ERR("Unknown type: %d", type);
68 static int __oal_type_to_media_prop(int oal_type)
85 case OAL_PLAY_POSITION:
92 BT_ERR("Unknown type: %d", oal_type);
99 int _bt_avrcp_connect_remote_target(bluetooth_device_address_t *device_address)
101 oal_status_t status = OAL_STATUS_SUCCESS;
102 int result = BLUETOOTH_ERROR_NONE;
105 status = avrcp_ct_connect((bt_address_t*)device_address);
106 if (status != OAL_STATUS_SUCCESS) {
107 BT_ERR("Connection could not be established, err: [%d]", status);
108 result = _bt_convert_oal_status_to_bt_error(status);
113 int _bt_avrcp_disconnect_remote_target(bluetooth_device_address_t *device_address)
115 oal_status_t status = OAL_STATUS_SUCCESS;
116 int result = BLUETOOTH_ERROR_NONE;
119 status = avrcp_ct_disconnect((bt_address_t*)device_address);
120 if (status != OAL_STATUS_SUCCESS) {
121 BT_ERR("DisConnection err: [%d]", status);
122 result = _bt_convert_oal_status_to_bt_error(status);
127 int _bt_avrcp_control_cmd(int type)
129 char connected_address[BT_ADDRESS_STRING_SIZE + 1];
131 bluetooth_device_address_t device_address;
132 oal_status_t status = OAL_STATUS_SUCCESS;
133 int result = BLUETOOTH_ERROR_NONE;
136 connected = _bt_is_headset_type_connected(BT_AVRCP, connected_address);
139 BT_ERR("Device is not connected:");
140 return BLUETOOTH_ERROR_NOT_CONNECTED;
143 _bt_convert_addr_string_to_type(device_address.addr,
146 case RC_PASS_CMD_PLAY:
147 status = avrcp_ct_play((bt_address_t*)&device_address);
149 case RC_PASS_CMD_PAUSE:
150 status = avrcp_ct_pause((bt_address_t*)&device_address);
152 case RC_PASS_CMD_STOP:
153 status = avrcp_ct_stop((bt_address_t*)&device_address);
155 case RC_PASS_CMD_NEXT:
156 status = avrcp_ct_next_track((bt_address_t*)&device_address);
158 case RC_PASS_CMD_PREVIOUS:
159 status = avrcp_ct_prev_track((bt_address_t*)&device_address);
161 case RC_PASS_CMD_PRESS_FAST_FORWARD:
162 status = avrcp_ct_fforward((bt_address_t*)&device_address, PRESS_STATE);
164 case RC_PASS_CMD_RELEASE_FAST_FORWARD:
165 status = avrcp_ct_fforward((bt_address_t*)&device_address, RELEASE_STATE);
167 case RC_PASS_CMD_PRESS_REWIND:
168 status = avrcp_ct_rewind((bt_address_t*)&device_address, PRESS_STATE);
170 case RC_PASS_CMD_RELEASE_REWIND:
171 status = avrcp_ct_rewind((bt_address_t*)&device_address, RELEASE_STATE);
173 case RC_PASS_CMD_VOLUME_UP:
174 status = avrcp_ct_volume_up((bt_address_t*)&device_address);
176 case RC_PASS_CMD_VOLUME_DOWN:
177 status = avrcp_ct_volume_down((bt_address_t*)&device_address);
183 if (status != OAL_STATUS_SUCCESS) {
184 BT_ERR("Send pass through command err: [%d]", status);
185 result = _bt_convert_oal_status_to_bt_error(status);
191 int _bt_avrcp_control_cmd_to_dest(int type, bluetooth_device_address_t *device_address)
193 char connected_address[BT_ADDRESS_STRING_SIZE + 1];
195 oal_status_t status = OAL_STATUS_SUCCESS;
196 int result = BLUETOOTH_ERROR_NONE;
199 _bt_convert_addr_type_to_string(connected_address, device_address->addr);
201 connected = _bt_is_headset_address_type_connected(BT_AVRCP,
202 (const char *)connected_address);
205 BT_ERR("Device is not connected:");
206 return BLUETOOTH_ERROR_NOT_CONNECTED;
210 case RC_PASS_CMD_PLAY:
211 status = avrcp_ct_play((bt_address_t*)device_address);
213 case RC_PASS_CMD_PAUSE:
214 status = avrcp_ct_pause((bt_address_t*)device_address);
216 case RC_PASS_CMD_STOP:
217 status = avrcp_ct_stop((bt_address_t*)device_address);
219 case RC_PASS_CMD_NEXT:
220 status = avrcp_ct_next_track((bt_address_t*)device_address);
222 case RC_PASS_CMD_PREVIOUS:
223 status = avrcp_ct_prev_track((bt_address_t*)device_address);
225 case RC_PASS_CMD_PRESS_FAST_FORWARD:
226 status = avrcp_ct_fforward((bt_address_t*)device_address, PRESS_STATE);
228 case RC_PASS_CMD_RELEASE_FAST_FORWARD:
229 status = avrcp_ct_fforward((bt_address_t*)device_address, RELEASE_STATE);
231 case RC_PASS_CMD_PRESS_REWIND:
232 status = avrcp_ct_rewind((bt_address_t*)device_address, PRESS_STATE);
234 case RC_PASS_CMD_RELEASE_REWIND:
235 status = avrcp_ct_rewind((bt_address_t*)device_address, RELEASE_STATE);
237 case RC_PASS_CMD_VOLUME_UP:
238 status = avrcp_ct_volume_up((bt_address_t*)device_address);
240 case RC_PASS_CMD_VOLUME_DOWN:
241 status = avrcp_ct_volume_down((bt_address_t*)device_address);
247 if (status != OAL_STATUS_SUCCESS) {
248 BT_ERR("Send pass through command err: [%d]", status);
249 result = _bt_convert_oal_status_to_bt_error(status);
255 int _bt_avrcp_control_set_property(int type, unsigned int value)
257 char connected_address[BT_ADDRESS_STRING_SIZE + 1];
259 bluetooth_device_address_t device_address;
260 oal_status_t status = OAL_STATUS_SUCCESS;
261 int result = BLUETOOTH_ERROR_NONE;
263 connected = _bt_is_headset_type_connected(BT_AVRCP, connected_address);
268 oal_type = __media_prop_to_oal_type(type);
269 retv_if(0 > oal_type, BLUETOOTH_ERROR_INVALID_PARAM);
271 _bt_convert_addr_string_to_type(device_address.addr,
273 status = avrcp_ct_set_property((bt_address_t*)&device_address,
275 if (status != OAL_STATUS_SUCCESS) {
276 BT_ERR("Set peoperty err: [%d]", status);
277 result = _bt_convert_oal_status_to_bt_error(status);
280 BT_ERR("Device is not connected:");
281 return BLUETOOTH_ERROR_NOT_CONNECTED;
286 int _bt_avrcp_transport_set_property(int type, unsigned int value)
288 char connected_address[BT_ADDRESS_STRING_SIZE + 1];
290 bluetooth_device_address_t device_address;
291 oal_status_t status = OAL_STATUS_SUCCESS;
292 int result = BLUETOOTH_ERROR_NONE;
294 connected = _bt_is_headset_type_connected(BT_AVRCP, connected_address);
297 _bt_convert_addr_string_to_type(device_address.addr,
299 status = avrcp_transport_set_property((bt_address_t*)&device_address,
301 if (status != OAL_STATUS_SUCCESS) {
302 BT_ERR("Set peoperty err: [%d]", status);
303 result = _bt_convert_oal_status_to_bt_error(status);
306 BT_ERR("Device is not connected:");
307 return BLUETOOTH_ERROR_NOT_CONNECTED;
312 int _bt_avrcp_control_get_property(int type)
314 char connected_address[BT_ADDRESS_STRING_SIZE + 1];
316 bt_address_t device_address;
317 oal_status_t status = OAL_STATUS_SUCCESS;
318 int result = BLUETOOTH_ERROR_NONE;
320 connected = _bt_is_headset_type_connected(BT_AVRCP, connected_address);
323 avrcp_ct_player_property_type_t oal_type;
325 _bt_convert_addr_string_to_type(
328 if (type == STATUS) {
329 status = avrcp_ct_get_play_status(&device_address);
330 if (status != OAL_STATUS_SUCCESS) {
331 BT_ERR("Get play status err: [%d]", status);
332 result = _bt_convert_oal_status_to_bt_error(status);
335 oal_type = __media_prop_to_oal_type(type);
336 retv_if(0 > oal_type, BLUETOOTH_ERROR_INVALID_PARAM);
338 status = avrcp_ct_get_property(&device_address, oal_type);
339 if (status != OAL_STATUS_SUCCESS) {
340 BT_ERR("Get peoperty err: [%d]", status);
341 result = _bt_convert_oal_status_to_bt_error(status);
345 BT_ERR("Device is not connected:");
346 return BLUETOOTH_ERROR_NOT_CONNECTED;
351 int _bt_avrcp_control_get_track_info(void)
353 char connected_address[BT_ADDRESS_STRING_SIZE + 1];
355 bluetooth_device_address_t device_address;
356 oal_status_t status = OAL_STATUS_SUCCESS;
357 int result = BLUETOOTH_ERROR_NONE;
359 connected = _bt_is_headset_type_connected(BT_AVRCP, connected_address);
362 _bt_convert_addr_string_to_type(
366 status = avrcp_ct_get_media_attribute((bt_address_t*)&device_address);
367 if (status != OAL_STATUS_SUCCESS) {
368 BT_ERR("Get track info err: [%d]", status);
369 result = _bt_convert_oal_status_to_bt_error(status);
372 BT_ERR("Device is not connected:");
373 return BLUETOOTH_ERROR_NOT_CONNECTED;
378 static void __bt_reply_avrcp_ct_connection_pending_request(bluetooth_device_address_t *address)
381 char addr[BT_ADDRESS_STRING_SIZE] = { 0 };
382 int result = BLUETOOTH_ERROR_NONE;
383 bluetooth_device_address_t device_address;
385 invocation_info_t *req_info;
386 memcpy(device_address.addr, address->addr, BLUETOOTH_ADDRESS_LENGTH);
387 _bt_convert_addr_type_to_string(addr, address->addr);
389 req_info = _bt_get_request_info_data(BT_AVRCP_CONTROL_CONNECT, addr);
390 if (NULL == req_info) {
391 BT_INFO("AVRCP CT Connect request not found or possibly already replied");
394 BT_INFO("AVRCP CT Connect request found for [%s]", addr);
397 out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
398 g_array_append_vals(out_param, addr, BT_ADDRESS_STRING_SIZE);
399 _bt_service_method_return(req_info->context,
401 g_array_free(out_param, TRUE);
402 g_free(req_info->user_data);
403 _bt_free_info_from_invocation_list(req_info);
406 static void __bt_handle_avrcp_target_connected_state(bluetooth_device_address_t *address)
408 char addr[BT_ADDRESS_STRING_SIZE] = { 0 };
410 int result = BLUETOOTH_ERROR_NONE;
411 ret_if(NULL == address);
414 _bt_convert_addr_type_to_string(addr, address->addr);
415 BT_INFO("Address of connected device [%s]", addr);
417 /* Add data from the connected list */
418 _bt_add_headset_to_list(BT_AVRCP, BT_STATE_CONNECTED, addr);
420 /* Replay to avrcp cotroller connect */
421 __bt_reply_avrcp_ct_connection_pending_request(address);
423 /* Send AVRCP(TARGET Role) connected event to Application */
424 param = g_variant_new("(is)", result, addr);
425 _bt_send_event(BT_AVRCP_CONTROL_EVENT, BLUETOOTH_EVENT_AVRCP_CONNECTED, param);
430 static void __bt_reply_avrcp_ct_disconnection_pending_request(bluetooth_device_address_t *address)
432 char addr[BT_ADDRESS_STRING_SIZE] = { 0 };
433 int result = BLUETOOTH_ERROR_NONE;
435 invocation_info_t *req_info;
438 _bt_convert_addr_type_to_string(addr, address->addr);
440 req_info = _bt_get_request_info_data(BT_AVRCP_CONTROL_DISCONNECT, addr);
441 if (NULL == req_info) {
442 BT_INFO("AVRCP CT Disconnect request not found or possibly already replied");
445 BT_INFO("AVRCP CT Disconnect request found for [%s]", addr);
448 out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
449 g_array_append_vals(out_param, addr, BT_ADDRESS_STRING_SIZE);
450 _bt_service_method_return(req_info->context,
452 g_array_free(out_param, TRUE);
453 g_free(req_info->user_data);
454 _bt_free_info_from_invocation_list(req_info);
457 static void __bt_avrcp_ct_reply_pending_requests(void)
460 int result = BLUETOOTH_ERROR_INTERNAL;
462 invocation_info_t *req_info;
465 for (l = _bt_get_invocation_list(); l != NULL;) {
469 if (req_info == NULL)
472 /* Create out param */
473 out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
475 BT_INFO("service_function: [0x%X]", req_info->service_function);
476 switch (req_info->service_function) {
477 case BT_AVRCP_GET_TRACK_INFO:
478 case BT_AVRCP_CONTROL_GET_PROPERTY: {
479 _bt_service_method_return(req_info->context, out_param, result);
480 _bt_free_info_from_invocation_list(req_info);
481 g_array_free(out_param, TRUE);
491 static void __bt_handle_avrcp_target_disconnected_state(bluetooth_device_address_t *address)
493 char addr[BT_ADDRESS_STRING_SIZE] = { 0 };
495 int result = BLUETOOTH_ERROR_NONE;
496 ret_if(NULL == address);
499 _bt_convert_addr_type_to_string(addr, address->addr);
500 BT_INFO("Address of disconnected device [%s]", addr);
502 /* Remove data from the connected list */
503 _bt_remove_headset_from_list(BT_AVRCP, addr);
505 /* Reply to avrcp cotroller connect */
506 __bt_reply_avrcp_ct_disconnection_pending_request(address);
508 /* Reply AVRCP CT pending requests */
509 __bt_avrcp_ct_reply_pending_requests();
511 /* Send AVRCP(TARGET Role) disconnected event to Application */
512 param = g_variant_new("(is)", result, addr);
513 _bt_send_event(BT_AVRCP_CONTROL_EVENT, BLUETOOTH_EVENT_AVRCP_DISCONNECTED, param);
518 static int __bt_oal_to_bt_event(int oal_event)
523 case OAL_EVENT_AVRCP_CT_EQUALIZER_STATUS:
524 ret = BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS;
526 case OAL_EVENT_AVRCP_CT_REPEAT_STATUS:
527 ret = BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS;
529 case OAL_EVENT_AVRCP_CT_SHUFFLE_STATUS:
530 ret = BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS;
532 case OAL_EVENT_AVRCP_CT_SCAN_STATUS:
533 ret = BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS;
535 case OAL_EVENT_AVRCP_CT_NOTIF_PLAY_POS_CHANGED:
536 ret = BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS;
538 case OAL_EVENT_AVRCP_CT_NOTIF_PLAY_STATUS_CHANGED:
539 ret = BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED;
547 static void __bt_handle_avrcp_target_player_property(unsigned int property_value, int oal_event)
551 /* Send AVRCP Target player property event to Application */
552 param = g_variant_new("(u)", property_value);
553 _bt_send_event(BT_AVRCP_CONTROL_EVENT,
554 __bt_oal_to_bt_event(oal_event), param);
557 static void __bt_handle_avrcp_track_info_changed(event_avrcp_ct_media_info_t* metadata)
560 unsigned int total_track = 0;
561 unsigned int track_number = 0;
562 unsigned int playing_time = 0;
570 total_track = (unsigned int)(metadata->total_track);
571 track_number = (unsigned int)(metadata->track_number);
572 playing_time = (unsigned int)(metadata->playing_time);
574 title = g_variant_new_from_data((const GVariantType *)"ay",
575 metadata->title_info, MEDIA_ATTIRBUTE_STRING_LENGTH,
577 artist = g_variant_new_from_data((const GVariantType *)"ay",
578 metadata->artist_info, MEDIA_ATTIRBUTE_STRING_LENGTH,
580 album = g_variant_new_from_data((const GVariantType *)"ay",
581 metadata->album_info, MEDIA_ATTIRBUTE_STRING_LENGTH,
583 genre = g_variant_new_from_data((const GVariantType *)"ay",
584 metadata->genre_info, MEDIA_ATTIRBUTE_STRING_LENGTH,
587 /* Send AVRCP Target player track info changed event to application*/
588 param = g_variant_new("(@ay@ay@ay@ayuuu)",
589 title, artist, album, genre,
590 total_track, track_number, playing_time);
592 BT_INFO("Total_track: %u, track_number: %u, playing_time: %u",
593 total_track, track_number, playing_time);
594 _bt_send_event(BT_AVRCP_CONTROL_EVENT,
595 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, param);
598 static invocation_info_t* __bt_get_request_info(int service_function)
601 invocation_info_t *req_info = NULL;
604 /* Get method invocation context */
605 for (l = _bt_get_invocation_list(); l != NULL; l = g_slist_next(l)) {
607 if (req_info == NULL || req_info->service_function != service_function)
614 static void __bt_handle_avrcp_track_info(event_avrcp_ct_media_info_t* metadata)
616 media_metadata_t meta_data;
617 invocation_info_t *req_info = NULL;
618 GArray *out_param = NULL;
619 int result = BLUETOOTH_ERROR_NONE;
621 req_info = __bt_get_request_info(BT_AVRCP_GET_TRACK_INFO);
622 ret_if(NULL == req_info);
624 memset(&meta_data, 0x00, sizeof(media_metadata_t));
626 memcpy(&meta_data.title, &metadata->title_info,
627 strlen((char *)metadata->title_info));
628 meta_data.title[strlen((char *)metadata->title_info)] = '\0';
630 memcpy(&meta_data.artist, &metadata->artist_info,
631 strlen((char *)metadata->artist_info));
632 meta_data.artist[strlen((char *)metadata->artist_info)] = '\0';
634 memcpy(&meta_data.album, &metadata->album_info,
635 strlen((char *)metadata->album_info));
636 meta_data.album[strlen((char *)metadata->album_info)] = '\0';
638 memcpy(&meta_data.genre, &metadata->genre_info,
639 strlen((char *)metadata->genre_info));
640 meta_data.genre[strlen((char *)metadata->genre_info)] = '\0';
642 meta_data.total_tracks = metadata->total_track;
643 meta_data.number = metadata->track_number;
644 meta_data.duration = metadata->playing_time;
646 out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
647 g_array_append_vals(out_param, &meta_data, sizeof(media_metadata_t));
649 _bt_service_method_return(req_info->context, out_param, result);
650 g_array_free(out_param, TRUE);
651 _bt_free_info_from_invocation_list(req_info);
654 static void __bt_handle_avrcp_pass_cmd_res(avrcp_ct_pass_cmd_t *pass_cmd)
656 BT_INFO(" Send Command Response [%d]", pass_cmd->key_code);
659 static void __bt_handle_avrcp_player_setting_res(avrcp_ct_playersetting_t *player_setting_res)
661 BT_INFO("Set Property Response [%d]", player_setting_res->accepted);
664 static void __bt_handle_avrcp_get_property_res_event(avrcp_ct_player_property_type_t oal_type, int value)
666 invocation_info_t *req_info = NULL;
667 GArray *out_param = NULL;
668 int result = BLUETOOTH_ERROR_NONE;
675 prop_type = __oal_type_to_media_prop(oal_type);
676 ret_if(0 > prop_type);
678 out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
679 g_array_append_vals(out_param, &value, sizeof(value));
681 /* Find and reply to all get requests for prop_type */
682 for (l = _bt_get_invocation_list(); l != NULL;) {
686 if (req_info == NULL)
689 type = *((int *)req_info->user_data);
690 if (req_info->service_function != BT_AVRCP_CONTROL_GET_PROPERTY
691 || type != prop_type)
694 BT_INFO("Request found");
695 _bt_service_method_return(req_info->context, out_param, result);
696 g_free(req_info->user_data);
697 _bt_free_info_from_invocation_list(req_info);
700 g_array_free(out_param, TRUE);
704 void _bt_avrcp_ctrl_event_handler(int oal_event, gpointer event_data)
707 bluetooth_device_address_t* bd_addr;
710 case OAL_EVENT_AVRCP_CT_CONNECTED: {
711 BT_INFO("AVRCP Controller Profile connected..");
712 bd_addr = (bluetooth_device_address_t*)event_data;
713 __bt_handle_avrcp_target_connected_state(bd_addr);
714 BT_PERMANENT_LOG("Connected AVRCP ct");
717 case OAL_EVENT_AVRCP_CT_DISCONNECTED: {
718 BT_INFO("AVRCP Controller Profile dissconnected..");
719 bd_addr = (bluetooth_device_address_t*)event_data;
720 __bt_handle_avrcp_target_disconnected_state(bd_addr);
721 BT_PERMANENT_LOG("Disconnected AVRCP ct");
724 case OAL_EVENT_AVRCP_CT_EQUALIZER_STATUS:
725 case OAL_EVENT_AVRCP_CT_REPEAT_STATUS:
726 case OAL_EVENT_AVRCP_CT_SHUFFLE_STATUS:
727 case OAL_EVENT_AVRCP_CT_SCAN_STATUS: {
728 avrcp_ct_property_value_t* property_val;
729 property_val = (avrcp_ct_property_value_t*)event_data;
730 __bt_handle_avrcp_target_player_property(property_val->value, oal_event);
733 case OAL_EVENT_AVRCP_CT_NOTIF_PLAY_STATUS_CHANGED:{
734 event_notif_avrcp_ct_notif_info_t* play_status_val;
735 play_status_val = (event_notif_avrcp_ct_notif_info_t*)event_data;
736 __bt_handle_avrcp_target_player_property(play_status_val->play_status, oal_event);
739 case OAL_EVENT_AVRCP_CT_NOTIF_PLAY_POS_CHANGED: {
740 event_notif_avrcp_ct_notif_info_t* play_position;
741 play_position = (event_notif_avrcp_ct_notif_info_t*)event_data;
742 __bt_handle_avrcp_target_player_property(play_position->song_pos, oal_event);
745 case OAL_EVENT_AVRCP_CT_NOTIF_TRACK_CHANGE: {
746 BT_INFO("AVRCP Controller Track Changed event..");
747 event_avrcp_ct_media_info_t* metadata = event_data;
749 __bt_handle_avrcp_track_info_changed(metadata);
752 case OAL_EVENT_AVRCP_CT_MEDIA_INFO: {
753 BT_INFO("AVRCP Controller Track Info event..");
754 event_avrcp_ct_media_info_t* metadata;
756 metadata = (event_avrcp_ct_media_info_t*)event_data;
757 __bt_handle_avrcp_track_info(metadata);
760 case OAL_EVENT_AVRCP_CT_GET_PROPERTY_RES: {
761 BT_INFO("AVRCP Controller Get Property response event..");
762 avrcp_ct_property_value_t *property = (avrcp_ct_property_value_t *)event_data;
763 __bt_handle_avrcp_get_property_res_event(property->type, property->value);
766 case OAL_EVENT_AVRCP_CT_PLAY_STATUS: {
767 BT_INFO("AVRCP Controller Get Play status response event..");
768 event_avrcp_ct_play_status_t *play_status_info = (event_avrcp_ct_play_status_t *)event_data;
769 __bt_handle_avrcp_get_property_res_event(OAL_PLAY_STATUS, play_status_info->play_status);
772 case OAL_EVENT_AVRCP_CT_PASS_CMD_RES: {
773 BT_INFO("AVRCP Controller Pass Command Res");
774 avrcp_ct_pass_cmd_t *pass_cmd;
776 pass_cmd = (avrcp_ct_pass_cmd_t *)event_data;
777 __bt_handle_avrcp_pass_cmd_res(pass_cmd);
780 case OAL_EVENT_AVRCP_CT_PLAYER_SETTING_RES: {
781 BT_INFO("AVRCP Player setting response");
782 avrcp_ct_playersetting_t *player_setting_res;
784 player_setting_res = (avrcp_ct_playersetting_t *)event_data;
785 __bt_handle_avrcp_player_setting_res(player_setting_res);
789 BT_INFO("Invalid Event = %d", oal_event);