From 32f62dc2b34edf4bd9898f9328ecdb9825ce7128 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 16 Nov 2012 15:26:47 +0200 Subject: [PATCH] core: Add default entry for PBAP Client --- src/profile.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/src/profile.c b/src/profile.c index 24ee2b5ef..ae73ccc3e 100644 --- a/src/profile.c +++ b/src/profile.c @@ -325,6 +325,32 @@ \ " +#define PCE_RECORD \ + " \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + " + struct ext_io; struct ext_profile { @@ -377,7 +403,6 @@ struct ext_io { bool resolving; btd_profile_cb cb; - uint32_t rec_handle; uint16_t version; uint16_t features; @@ -1366,6 +1391,12 @@ static char *get_dun_record(struct ext_profile *ext, struct ext_io *l2cap, ext->name); } +static char *get_pce_record(struct ext_profile *ext, struct ext_io *l2cap, + struct ext_io *rfcomm) +{ + return g_strdup_printf(PCE_RECORD, ext->version, ext->name); +} + static char *get_opp_record(struct ext_profile *ext, struct ext_io *l2cap, struct ext_io *rfcomm) { @@ -1467,6 +1498,12 @@ static struct default_settings { .uuid = OBEX_PSE_UUID, .name = "Phone Book Access", .channel = PBAP_DEFAULT_CHANNEL, + }, { + .uuid = OBEX_PCE_UUID, + .name = "Phone Book Access Client", + .remote_uuid = OBEX_PSE_UUID, + .get_record = get_pce_record, + .version = 0x0101, }, { .uuid = OBEX_MAS_UUID, .name = "Message Access", @@ -1695,7 +1732,7 @@ static struct ext_profile *create_ext(const char *owner, const char *path, * http://c-faq.com/ansi/constmismatch.html */ p->remote_uuids = (const char **) ext->remote_uuids; - if (ext->enable_server) { + if (ext->enable_server || ext->record || ext->get_record) { p->adapter_probe = ext_adapter_probe; p->adapter_remove = ext_adapter_remove; } -- 2.47.3