From 6ede436278b026a54decb5d84ade1426103a0746 Mon Sep 17 00:00:00 2001 From: Christian Fetzer Date: Tue, 9 Apr 2013 13:51:33 +0200 Subject: [PATCH] profile: Add MNS server record This adds the MNS server record to the profile default settings. --- src/profile.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/profile.c b/src/profile.c index 29f9ee601..55e72dd34 100644 --- a/src/profile.c +++ b/src/profile.c @@ -435,6 +435,44 @@ \ " +#define MNS_RECORD \ + " \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + " + #define SYNC_RECORD \ " \ \ @@ -1709,6 +1747,20 @@ static char *get_mas_record(struct ext_profile *ext, struct ext_io *l2cap, ext->name); } +static char *get_mns_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(MNS_RECORD, chan, ext->version, ext->name, psm); +} + static char *get_sync_record(struct ext_profile *ext, struct ext_io *l2cap, struct ext_io *rfcomm) { @@ -1899,6 +1951,9 @@ static struct default_settings { .uuid = OBEX_MNS_UUID, .name = "Message Notification", .channel = MNS_DEFAULT_CHANNEL, + .psm = BTD_PROFILE_PSM_AUTO, + .get_record = get_mns_record, + .version = 0x0100 }, }; -- 2.47.3