Add AVRCP control volume up / down method
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-avrcp-controller.c
index 39085ed..be6ce19 100644 (file)
@@ -216,6 +216,12 @@ int _bt_avrcp_control_cmd(int type)
        case RELEASE_REWIND:
                ret = __bt_media_send_control_msg("ReleaseRewind");
                break;
+       case VOLUME_UP:
+               ret = __bt_media_send_control_msg("VolumeUp");
+               break;
+       case VOLUME_DOWN:
+               ret = __bt_media_send_control_msg("VolumeDown");
+               break;
        default:
                BT_DBG("Invalid Type\n");
                return BLUETOOTH_ERROR_INTERNAL;
@@ -537,14 +543,11 @@ int _bt_avrcp_control_set_property(int type, unsigned int value)
 
 int _bt_avrcp_transport_set_property(int type, unsigned int value)
 {
-       GValue *attr_value = NULL;
        GDBusProxy *proxy = NULL;
        GError *error = NULL;
        GVariant *reply, *param;
        uint16_t property_level = (uint16_t)value;
 
-       g_value_init(attr_value, G_TYPE_STRING);
-
        switch (type) {
        case DELAY:
                param = g_variant_new("q", property_level);
@@ -556,7 +559,6 @@ int _bt_avrcp_transport_set_property(int type, unsigned int value)
                break;
        default:
                BT_ERR("Invalid property type: %d", type);
-               g_value_unset(attr_value);
                return BLUETOOTH_ERROR_INTERNAL;
        }
 
@@ -580,7 +582,6 @@ int _bt_avrcp_transport_set_property(int type, unsigned int value)
        }
 
        g_variant_unref(reply);
-       g_value_unset(attr_value);
 
        return BLUETOOTH_ERROR_NONE;
 }