Add AVRCP control volume up / down method
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / oal-avrcp-ctrl.c
index c69c22a..9a6d8d0 100644 (file)
@@ -566,8 +566,6 @@ static void cb_avrcp_ct_trak_info_chnaged(bt_bdaddr_t *device_address,
                                track_info->total_track = g_ascii_strtoll(
                                                (const gchar *)p_attrs[idx].text, NULL, 10);
                                event_data->total_track = track_info->total_track;
-                       } else {
-                               BT_WARN("string is null!!!!!!!");
                        }
                        break;
                case BTRC_MEDIA_ATTR_ID_TRACK_NUM:
@@ -575,8 +573,6 @@ static void cb_avrcp_ct_trak_info_chnaged(bt_bdaddr_t *device_address,
                                track_info->track_number = g_ascii_strtoll(
                                                (const gchar *)p_attrs[idx].text, NULL, 10);
                                event_data->track_number = track_info->track_number;
-                       } else {
-                               BT_WARN("string is null!!!!!!!");
                        }
                        break;
                case BTRC_MEDIA_ATTR_ID_PLAYING_TIME:
@@ -676,6 +672,30 @@ oal_status_t avrcp_ct_prev_track(bt_address_t *device_address)
        return result;
 }
 
+oal_status_t avrcp_ct_volume_up(bt_address_t *device_address)
+{
+       oal_status_t result = OAL_STATUS_SUCCESS;
+
+       API_TRACE();
+
+       result = __avrcp_ct_send_pass_through_cmd(device_address,
+                       OAL_RC_PASS_CMD_VOLUME_UP, PRESS_STATE);
+
+       return result;
+}
+
+oal_status_t avrcp_ct_volume_down(bt_address_t *device_address)
+{
+       oal_status_t result = OAL_STATUS_SUCCESS;
+
+       API_TRACE();
+
+       result = __avrcp_ct_send_pass_through_cmd(device_address,
+                       OAL_RC_PASS_CMD_VOLUME_DOWN, PRESS_STATE);
+
+       return result;
+}
+
 oal_status_t avrcp_ct_fforward(bt_address_t *device_address, avrcp_ct_pass_state_t press_state)
 {
        oal_status_t result = OAL_STATUS_SUCCESS;
@@ -771,6 +791,30 @@ oal_status_t avrcp_ct_set_property(bt_address_t *device_address, avrcp_ct_player
        return result;
 }
 
+oal_status_t avrcp_transport_set_property(bt_address_t *device_address, int type, unsigned int value)
+{
+       int result = OAL_STATUS_SUCCESS;
+       bt_status_t status;
+       bdstr_t bdstr;
+
+       API_TRACE();
+
+       CHECK_OAL_AVRCP_CTRL_ENABLED();
+       BT_INFO("BT Audio Address: %s", bdt_bd2str(device_address, &bdstr));
+
+       if (type) {
+               status = avrcp_ct_interface->set_transport_setting_cmd((bt_bdaddr_t *)device_address, NO_OF_ATTRIBUTE,
+                               &type, &value);
+               if ((status != BT_STATUS_SUCCESS) && (status != BT_STATUS_DONE)) {
+                       BT_ERR("OAL, Set property failed err: %s", status2string(status));
+                       result =  convert_to_oal_status(status);
+               }
+       } else {
+               result = OAL_STATUS_INTERNAL_ERROR;
+       }
+       return result;
+}
+
 static gboolean __send_avrcp_property_event(gpointer data)
 {
        avrcp_ct_property_value_t *event_data = (avrcp_ct_property_value_t *)data;