From 8e318cecb3a2438cdef8278b9c0083cec5688dfe Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 15 Nov 2012 15:04:48 +0200 Subject: [PATCH] core: Add support for default OPP record --- src/profile.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/src/profile.c b/src/profile.c index 6bf17821d..e41eace6c 100644 --- a/src/profile.c +++ b/src/profile.c @@ -228,6 +228,60 @@ \ " +#define OPP_RECORD \ + " \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + " + struct ext_io; struct ext_profile { @@ -1232,6 +1286,20 @@ static char *get_dun_record(struct ext_profile *ext, struct ext_io *l2cap, ext->name); } +static char *get_opp_record(struct ext_profile *ext, struct ext_io *l2cap, + struct ext_io *rfcomm) +{ + uint16_t psm = 0; + uint8_t chan = 0; + + if (l2cap) + psm = l2cap->psm; + if (rfcomm) + chan = rfcomm->chan; + + return g_strdup_printf(OPP_RECORD, chan, ext->version, psm, ext->name); +} + static struct default_settings { const char *uuid; const char *name; @@ -1285,8 +1353,11 @@ static struct default_settings { .uuid = OBEX_OPP_UUID, .name = "Object Push", .channel = OPP_DEFAULT_CHANNEL, + .psm = BTD_PROFILE_PSM_AUTO, .sec_level = BT_IO_SEC_LOW, .authorize = false, + .get_record = get_opp_record, + .version = 0x0102, }, { .uuid = OBEX_FTP_UUID, .name = "File Transfer", -- 2.11.0