Fix BT enable issue on XU3 TV profile
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-avrcp.c
index d0fa661..9c6ba9a 100644 (file)
@@ -392,6 +392,35 @@ BT_EXPORT_API int bluetooth_media_control_command(
        return result;
 }
 
+BT_EXPORT_API int bluetooth_media_control_command_to_dest(
+                                               media_player_control_cmd type,
+                                               bluetooth_device_address_t *remote_address)
+{
+       int result;
+
+       BT_CHECK_ENABLED(return);
+
+#ifdef TIZEN_FEATURE_BT_DPM
+       if (_bt_check_dpm(BT_DPM_AVRCP, NULL) == BT_DPM_RESTRICTED) {
+               BT_ERR("Not allow to use AVRCP profile");
+               return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
+       }
+#endif
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       g_array_append_vals(in_param1, &type, sizeof(int));
+       g_array_append_vals(in_param2, remote_address,
+                                               sizeof(bluetooth_device_address_t));
+
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_AVRCP_HANDLE_CONTROL_TO_DEST,
+               in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       return result;
+}
+
 BT_EXPORT_API int bluetooth_media_control_set_property(
                                                media_player_property_type type,
                                                unsigned int value)