[PATCH 4/9] avctp: Convert avctp_get to accept audio_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use addresses taken from btd_dev reference in audio_device to get
session source and destination.
---
 profiles/audio/avctp.c   |    8 +++++++-
 profiles/audio/avctp.h   |    2 +-
 profiles/audio/avrcp.c   |    2 +-
 profiles/audio/control.c |    2 +-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index 6752cef..a7daef3 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -1671,7 +1671,13 @@ void avctp_disconnect(struct avctp *session)
 	avctp_set_state(session, AVCTP_STATE_DISCONNECTED);
 }
 
-struct avctp *avctp_get(const bdaddr_t *src, const bdaddr_t *dst)
+struct avctp *avctp_get(struct audio_device *device)
 {
+	const bdaddr_t *src;
+	const bdaddr_t *dst;
+
+	src = adapter_get_address(device_get_adapter(device->btd_dev));
+	dst = device_get_address(device->btd_dev);
+
 	return avctp_get_internal(src, dst);
 }
diff --git a/profiles/audio/avctp.h b/profiles/audio/avctp.h
index 7314a04..2597e6e 100644
--- a/profiles/audio/avctp.h
+++ b/profiles/audio/avctp.h
@@ -94,7 +94,7 @@ int avctp_register(const bdaddr_t *src, gboolean master);
 void avctp_unregister(const bdaddr_t *src);
 
 struct avctp *avctp_connect(struct audio_device *device);
-struct avctp *avctp_get(const bdaddr_t *src, const bdaddr_t *dst);
+struct avctp *avctp_get(struct audio_device *device);
 int avctp_connect_browsing(struct avctp *session);
 void avctp_disconnect(struct avctp *session);
 
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index f6a5ac9..d5f23da 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2265,7 +2265,7 @@ void avrcp_disconnect(struct audio_device *dev)
 {
 	struct avctp *session;
 
-	session = avctp_get(&dev->src, &dev->dst);
+	session = avctp_get(dev);
 	if (!session)
 		return;
 
diff --git a/profiles/audio/control.c b/profiles/audio/control.c
index 5b16e17..fea49b6 100644
--- a/profiles/audio/control.c
+++ b/profiles/audio/control.c
@@ -110,7 +110,7 @@ static void state_changed(struct audio_device *dev, avctp_state_t old_state,
 		if (control->session)
 			break;
 
-		control->session = avctp_get(&dev->src, &dev->dst);
+		control->session = avctp_get(dev);
 
 		break;
 	case AVCTP_STATE_CONNECTED:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux