From e4fd52d2a561acc511e31e535496d6bee039653b Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 15 Nov 2012 15:32:15 +0200 Subject: [PATCH] core: Add default SDP record for FTP --- src/profile.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/profile.c b/src/profile.c index 7bd3445c3..33abf7efd 100644 --- a/src/profile.c +++ b/src/profile.c @@ -282,6 +282,49 @@ \ " +#define FTP_RECORD \ + " \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + " + struct ext_io; struct ext_profile { @@ -1300,6 +1343,20 @@ static char *get_opp_record(struct ext_profile *ext, struct ext_io *l2cap, return g_strdup_printf(OPP_RECORD, chan, ext->version, psm, ext->name); } +static char *get_ftp_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(FTP_RECORD, chan, ext->version, psm, ext->name); +} + static struct default_settings { const char *uuid; const char *name; @@ -1362,6 +1419,9 @@ static struct default_settings { .uuid = OBEX_FTP_UUID, .name = "File Transfer", .channel = FTP_DEFAULT_CHANNEL, + .psm = BTD_PROFILE_PSM_AUTO, + .get_record = get_ftp_record, + .version = 0x0102, }, { .uuid = OBEX_BIP_UUID, .name = "Basic Imaging", -- 2.47.3