Diff between ac06c7f76c16711dac12e606166cc44f8c02d39d and 0a0223bec818c0f4d14a3c2d58bcd4b447668aa1

Changed Files

File Additions Deletions Status
src/profile.c +15 -0 modified

Full Patch

diff --git a/src/profile.c b/src/profile.c
index a58e9f9..ba9ce6c 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;