From 0a0223bec818c0f4d14a3c2d58bcd4b447668aa1 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 26 Sep 2012 14:47:39 +0300 Subject: [PATCH] core: Add basic defaults lookup to external profiles --- src/profile.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/profile.c b/src/profile.c index a58e9f91c..ba9ce6c78 100644 --- a/src/profile.c +++ b/src/profile.c @@ -218,6 +218,19 @@ static int ext_adapter_probe(struct btd_profile *p, return ext_start_servers(ext, adapter); } +static void ext_get_defaults(struct ext_profile *ext) +{ + if (ext->psm || ext->chan) + return; + + if (strcasecmp(ext->uuid, "spp") == 0) { + if (g_strcmp0(ext->role, "client") == 0) + return; + + ext->chan = 3; + } +} + static int parse_ext_opt(struct ext_profile *ext, const char *key, DBusMessageIter *value) { @@ -306,6 +319,8 @@ static struct ext_profile *create_ext(const char *owner, const char *path, if (!ext->name) ext->name = g_strdup_printf("%s%s/%s", owner, path, uuid); + ext_get_defaults(ext); + p = &ext->p; p->name = ext->name; -- 2.47.3