Diff between 32f62dc2b34edf4bd9898f9328ecdb9825ce7128 and 6a7a6d66462ced151cf7a3fc47860cbbc446d2d1

Changed Files

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

Full Patch

diff --git a/src/profile.c b/src/profile.c
index ae73ccc..7d56edc 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -351,6 +351,49 @@
 		</attribute>						\
 	</record>"
 
+#define PSE_RECORD							\
+	"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>			\
+	<record>							\
+		<attribute id=\"0x0001\">				\
+			<sequence>					\
+				<uuid value=\"0x112f\" />		\
+			</sequence>					\
+		</attribute>						\
+		<attribute id=\"0x0004\">				\
+			<sequence>					\
+				<sequence>				\
+					<uuid value=\"0x0100\" />	\
+				</sequence>				\
+				<sequence>				\
+					<uuid value=\"0x0003\" />	\
+					<uint8 value=\"0x%02x\" />	\
+				</sequence>				\
+				<sequence>				\
+					<uuid value=\"0x0008\"/>	\
+				</sequence>				\
+			</sequence>					\
+		</attribute>						\
+		<attribute id=\"0x0005\">				\
+			<sequence>					\
+				<uuid value=\"0x1002\" />		\
+			</sequence>					\
+		</attribute>						\
+		<attribute id=\"0x0009\">				\
+			<sequence>					\
+				<sequence>				\
+					<uuid value=\"0x1130\" />	\
+					<uint16 value=\"0x%04x\" />	\
+				</sequence>				\
+			</sequence>					\
+		</attribute>						\
+		<attribute id=\"0x0100\">				\
+			<text value=\"%s\" />				\
+		</attribute>						\
+		<attribute id=\"0x0314\">				\
+			<uint8 value=\"0x01\"/>				\
+		</attribute>						\
+	</record>"
+
 struct ext_io;
 
 struct ext_profile {
@@ -1397,6 +1440,13 @@ static char *get_pce_record(struct ext_profile *ext, struct ext_io *l2cap,
 	return g_strdup_printf(PCE_RECORD, ext->version, ext->name);
 }
 
+static char *get_pse_record(struct ext_profile *ext, struct ext_io *l2cap,
+							struct ext_io *rfcomm)
+{
+	return g_strdup_printf(PSE_RECORD, rfcomm->chan, ext->version,
+								ext->name);
+}
+
 static char *get_opp_record(struct ext_profile *ext, struct ext_io *l2cap,
 							struct ext_io *rfcomm)
 {
@@ -1498,6 +1548,8 @@ static struct default_settings {
 		.uuid		= OBEX_PSE_UUID,
 		.name		= "Phone Book Access",
 		.channel	= PBAP_DEFAULT_CHANNEL,
+		.get_record	= get_pse_record,
+		.version	= 0x0101,
 	}, {
 		.uuid		= OBEX_PCE_UUID,
 		.name		= "Phone Book Access Client",