[PATCH BlueZ 1/2] control: Add a way to identify the role of a avrcp connection

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

 



---
 profiles/audio/control.c | 8 ++++++++
 profiles/audio/control.h | 7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/profiles/audio/control.c b/profiles/audio/control.c
index cdba385..480e6b2 100644
--- a/profiles/audio/control.c
+++ b/profiles/audio/control.c
@@ -328,3 +328,11 @@ gboolean control_is_active(struct audio_device *dev)
 
 	return FALSE;
 }
+
+enum control_role_t control_get_role(struct control *control)
+{
+	if (control->remote)
+		return CONTROL_ROLE_REMOTE;
+	else
+		return CONTROL_ROLE_TARGET;
+}
diff --git a/profiles/audio/control.h b/profiles/audio/control.h
index 0a0f208..6f08b0b 100644
--- a/profiles/audio/control.h
+++ b/profiles/audio/control.h
@@ -26,12 +26,19 @@
 
 struct btd_service;
 
+enum control_role_t {
+	CONTROL_ROLE_REMOTE,
+	CONTROL_ROLE_TARGET,
+};
+
 struct control *control_init(struct audio_device *dev,
 						struct btd_service *service);
 void control_update(struct control *control, struct btd_service *service);
 void control_unregister(struct audio_device *dev);
 gboolean control_is_active(struct audio_device *dev);
 
+enum control_role_t control_get_role(struct control *control);
+
 int control_connect(struct audio_device *dev);
 int control_disconnect(struct audio_device *dev);
 
-- 
1.8.2.2

--
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