diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-10-09 14:11:16 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-10-09 15:13:28 +0200 |
commit | 548026e08bd9b83b3685d515a916e2cf674184f3 (patch) | |
tree | 75f707ae2a4b825ae7f60cef44f54a74579e21a0 /audio/headset.c | |
parent | 99c24bafe1619e6ace7e89be2ddea2e8f2eaf98f (diff) |
Make device driver probe calls take UUID's instead of full records
This is preparation for allowing the device object to be correctly set up even
when we don't have the full service records but only the remote UUID's.
Diffstat (limited to 'audio/headset.c')
-rw-r--r-- | audio/headset.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/audio/headset.c b/audio/headset.c index ca7cc189..6599e1d7 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -59,6 +59,8 @@ #include "headset.h" #include "glib-helper.h" #include "dbus-common.h" +#include "../src/adapter.h" +#include "../src/device.h" #define DC_TIMEOUT 3000 @@ -1810,8 +1812,8 @@ static GDBusSignalTable headset_signals[] = { { NULL, NULL } }; -static void headset_set_channel(struct headset *headset, sdp_record_t *record, - uint16_t svc) +static void headset_set_channel(struct headset *headset, + const sdp_record_t *record, uint16_t svc) { int ch; sdp_list_t *protos; @@ -1835,9 +1837,15 @@ static void headset_set_channel(struct headset *headset, sdp_record_t *record, error("Unable to get RFCOMM channel from Headset record"); } -void headset_update(struct audio_device *dev, sdp_record_t *record, uint16_t svc) +void headset_update(struct audio_device *dev, uint16_t svc, + const char *uuidstr) { struct headset *headset = dev->headset; + const sdp_record_t *record; + + record = btd_device_get_record(dev->btd_dev, uuidstr); + if (!record) + return; switch (svc) { case HANDSFREE_SVCLASS_ID: @@ -1918,10 +1926,11 @@ void headset_unregister(struct audio_device *dev) AUDIO_HEADSET_INTERFACE); } -struct headset *headset_init(struct audio_device *dev, sdp_record_t *record, - uint16_t svc) +struct headset *headset_init(struct audio_device *dev, uint16_t svc, + const char *uuidstr) { struct headset *hs; + const sdp_record_t *record; hs = g_new0(struct headset, 1); hs->rfcomm_ch = -1; @@ -1931,6 +1940,7 @@ struct headset *headset_init(struct audio_device *dev, sdp_record_t *record, hs->hfp_active = FALSE; hs->cli_active = FALSE; + record = btd_device_get_record(dev->btd_dev, uuidstr); if (!record) goto register_iface; |