Diff between 430b8b1b024b4f452aa1f641137c9b132c812435 and c6dcf6b714501768ab7ea293e75d945be0eec188

Changed Files

File Additions Deletions Status
configure.ac +3 -0 modified
profiles/audio/transport.c +8 -0 modified

Full Patch

diff --git a/configure.ac b/configure.ac
index 9559086..9f1a966 100644
--- a/configure.ac
+++ b/configure.ac
@@ -215,6 +215,9 @@ AM_CONDITIONAL(CCP, test "${enable_ccp}" != "no")
 AC_ARG_ENABLE(vcp, AS_HELP_STRING([--disable-vcp],
 		[disable VCP profile]), [enable_vcp=${enableval}])
 AM_CONDITIONAL(VCP, test "${enable_vcp}" != "no")
+if test "${enable_vcp}" != "no"; then
+	AC_DEFINE(HAVE_VCP, 1, [Define to 1 if you have VCP support.])
+fi
 
 AC_ARG_ENABLE(micp, AS_HELP_STRING([--disable-micp],
 		[disable MICP profile]), [enable_micp=${enableval}])
diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index ab149bc..2682a2e 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -2263,16 +2263,24 @@ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd,
 
 static int transport_bap_get_volume(struct media_transport *transport)
 {
+#ifdef HAVE_VCP
 	return bt_audio_vcp_get_volume(transport->device);
+#else
+	return -ENODEV;
+#endif /* HAVE_VCP */
 }
 
 static int transport_bap_set_volume(struct media_transport *transport,
 								int volume)
 {
+#ifdef HAVE_VCP
 	if (volume < 0 || volume > 255)
 		return -EINVAL;
 
 	return bt_audio_vcp_set_volume(transport->device, volume) ? 0 : -EIO;
+#else
+	return -ENODEV;
+#endif /* HAVE_VCP */
 }
 
 static void transport_bap_destroy(void *data)