Skip to contentSkip to conversation

core/profile: Fix MNS record version

PATCH In review Luiz Augusto von Dentz 2 participants 8 messages Oct 9, 2013

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/7 core/profile: Fix MNS record version

From: Luiz Augusto von Dentz <[email protected]>

To be able to use OBEX over L2CAP the version number should be at least 0x102, in addition to that ERTM mode should be used to comply to GOEP 2.0.

---
 src/profile.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/profile.c +2 -1
index e2473a6..6e769c6 100644
@@ -1996,9 +1996,10 @@ static struct default_settings {
 		.name		= "Message Notification",
 		.channel	= MNS_DEFAULT_CHANNEL,
 		.psm		= BTD_PROFILE_PSM_AUTO,
+		.mode		= BT_IO_MODE_ERTM,
 		.authorize	= true,
 		.get_record	= get_mns_record,
-		.version	= 0x0100
+		.version	= 0x0102
 	},
 };
 
Signature · 1 line
1.8.3.1
author maintainer
#1 lore raw

PATCH 2/7 obexd/MAP: Fix sending \0 after filler byte

From: Luiz Augusto von Dentz <[email protected]>

It is not necessary to append \0 after the filler byte (0x30), the spec just talk about the a byte not bytes.

---
 obexd/client/map.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
obexd/client/map.c +3 -6
index 4373d74..9d90a92 100644
@@ -729,7 +729,7 @@ static void set_status(const GDBusPropertyTable *property,
 	gboolean value;
 	GError *err = NULL;
 	GObexApparam *apparam;
-	char contents[2];
+	char contents[1];
 	char handle[21];
 
 	if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BOOLEAN) {
@@ -742,7 +742,6 @@ static void set_status(const GDBusPropertyTable *property,
 	dbus_message_iter_get_basic(iter, &value);
 
 	contents[0] = FILLER_BYTE;
-	contents[1] = '\0';
 
 	if (snprintf(handle, sizeof(handle), "%" PRIu64, msg->handle) < 0)
 		goto fail;
@@ -1612,13 +1611,12 @@ static DBusMessage *map_update_inbox(DBusConnection *connection,
 {
 	struct map_data *map = user_data;
 	DBusMessage *reply;
-	char contents[2];
+	char contents[1];
 	struct obc_transfer *transfer;
 	GError *err = NULL;
 	struct pending_request *request;
 
 	contents[0] = FILLER_BYTE;
-	contents[1] = '\0';
 
 	transfer = obc_transfer_put("x-bt/MAP-messageUpdate", NULL, NULL,
 						contents, sizeof(contents),
@@ -1935,7 +1933,7 @@ static bool set_notification_registration(struct map_data *map, bool status)
 	struct obc_transfer *transfer;
 	GError *err = NULL;
 	GObexApparam *apparam;
-	char contents[2];
+	char contents[1];
 	const char *address;
 
 	address = obc_session_get_destination(map->session);
@@ -1951,7 +1949,6 @@ static bool set_notification_registration(struct map_data *map, bool status)
 	}
 
 	contents[0] = FILLER_BYTE;
-	contents[1] = '\0';
 
 	transfer = obc_transfer_put("x-bt/MAP-NotificationRegistration", NULL,
 					NULL, contents, sizeof(contents), &err);
Signature · 1 line
1.8.3.1
author maintainer
#2 lore raw

PATCH 3/7 obexd/MAP: Fix parsing message handles as decimal numbers

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

The spec clearly states the handles are hexadecimal:

MAP 1.2 - Page 29

""handle" is the message handle in hexadecimal representation with up to 16 digits; leading zero digits may be used so the MCE shall accept both handles with and without leading zeros (e.g.,"00000012345678AB" or "12345678AB")."

---
 obexd/client/map.c | 12 ++++++------
 obexd/client/mns.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
obexd/client/map.c +6 -6
index 9d90a92..d2d3d81 100644
@@ -435,7 +435,7 @@ static DBusMessage *map_msg_get(DBusConnection *connection,
 	GError *err = NULL;
 	DBusMessage *reply;
 	GObexApparam *apparam;
-	char handle[21];
+	char handle[17];
 
 	if (dbus_message_get_args(message, NULL,
 				DBUS_TYPE_STRING, &target_file,
@@ -444,7 +444,7 @@ static DBusMessage *map_msg_get(DBusConnection *connection,
 		return g_dbus_create_error(message,
 				ERROR_INTERFACE ".InvalidArguments", NULL);
 
-	if (snprintf(handle, sizeof(handle), "%" PRIu64, msg->handle) < 0)
+	if (snprintf(handle, sizeof(handle), "%" PRIx64, msg->handle) < 0)
 		goto fail;
 
 	transfer = obc_transfer_get("x-bt/message", handle, target_file, &err);
@@ -730,7 +730,7 @@ static void set_status(const GDBusPropertyTable *property,
 	GError *err = NULL;
 	GObexApparam *apparam;
 	char contents[1];
-	char handle[21];
+	char handle[17];
 
 	if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BOOLEAN) {
 		g_dbus_pending_property_error(id,
@@ -743,7 +743,7 @@ static void set_status(const GDBusPropertyTable *property,
 
 	contents[0] = FILLER_BYTE;
 
-	if (snprintf(handle, sizeof(handle), "%" PRIu64, msg->handle) < 0)
+	if (snprintf(handle, sizeof(handle), "%" PRIx64, msg->handle) < 0)
 		goto fail;
 
 	transfer = obc_transfer_put("x-bt/messageStatus", handle, NULL,
@@ -1110,7 +1110,7 @@ static void msg_element(GMarkupParseContext *ctxt, const char *element,
 			break;
 	}
 
-	handle = strtoull(values[i], NULL, 10);
+	handle = strtoull(values[i], NULL, 16);
 
 	msg = g_hash_table_lookup(data->messages, &handle);
 	if (msg == NULL) {
@@ -1897,7 +1897,7 @@ static void map_handle_notification(struct map_event *event, void *user_data)
 
 	DBG("Event report for %s:%d", obc_session_get_destination(map->session),
 							map->mas_instance_id);
-	DBG("type=%x handle=%" PRIu64 " folder=%s old_folder=%s msg_type=%s",
+	DBG("type=%x handle=%" PRIx64 " folder=%s old_folder=%s msg_type=%s",
 		event->type, event->handle, event->folder, event->old_folder,
 		event->msg_type);
 
obexd/client/mns.c +1 -1
index 2d2730d..d638886 100644
@@ -185,7 +185,7 @@ static void parse_event_report_type(struct map_event *event, const char *value)
 static void parse_event_report_handle(struct map_event *event,
 							const char *value)
 {
-	event->handle = strtoull(value, NULL, 10);
+	event->handle = strtoull(value, NULL, 16);
 }
 
 static void parse_event_report_folder(struct map_event *event,
Signature · 1 line
1.8.3.1
author maintainer
#3 lore raw

PATCH 4/7 lib/sdp: Replace VIDEO_CONF_SVCLASS_ID with AV_REMOTE_CONTROLLER_SVCLASS_ID

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

VCP apparently was never adopted so 0x110f was latter reused by AVRCP 1.3 controller as per current assigned numbers page:

https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery

---
 lib/sdp.c         | 2 +-
 lib/sdp.h         | 2 +-
 src/glib-helper.c | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)
lib/sdp.c +1 -1
index 1405c50..cbdf15e 100644
@@ -125,7 +125,7 @@ static struct tupla ServiceClass[] = {
 	{ AV_REMOTE_TARGET_SVCLASS_ID,		"AV Remote Target"		},
 	{ ADVANCED_AUDIO_SVCLASS_ID,		"Advanced Audio"		},
 	{ AV_REMOTE_SVCLASS_ID,			"AV Remote"			},
-	{ VIDEO_CONF_SVCLASS_ID,		"Video Conferencing"		},
+	{ AV_REMOTE_CONTROLLER_SVCLASS_ID,	"AV Remote Controller"		},
 	{ INTERCOM_SVCLASS_ID,			"Intercom"			},
 	{ FAX_SVCLASS_ID,			"Fax"				},
 	{ HEADSET_AGW_SVCLASS_ID,		"Headset Audio Gateway"		},
lib/sdp.h +1 -1
index 4ef2176..f2f2484 100644
@@ -95,7 +95,7 @@ extern "C" {
 #define AV_REMOTE_TARGET_SVCLASS_ID	0x110c
 #define ADVANCED_AUDIO_SVCLASS_ID	0x110d
 #define AV_REMOTE_SVCLASS_ID		0x110e
-#define VIDEO_CONF_SVCLASS_ID		0x110f
+#define AV_REMOTE_CONTROLLER_SVCLASS_ID	0x110f
 #define INTERCOM_SVCLASS_ID		0x1110
 #define FAX_SVCLASS_ID			0x1111
 #define HEADSET_AGW_SVCLASS_ID		0x1112
src/glib-helper.c +0 -1
index a9a9a6e..4a020e9 100644
@@ -103,7 +103,6 @@ static struct {
 	const char	*name;
 	uint16_t	class;
 } bt_services[] = {
-	{ "vcp",	VIDEO_CONF_SVCLASS_ID		},
 	{ "pbap",	PBAP_SVCLASS_ID			},
 	{ "sap",	SAP_SVCLASS_ID			},
 	{ "ftp",	OBEX_FILETRANS_SVCLASS_ID	},
Signature · 1 line
1.8.3.1
author maintainer
#4 lore raw

PATCH 5/7 profiles/AVRCP: Add AV Remote Controller service class id to CT

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Both AV Remote and AV Remote Controller service classes are mandatory by AVRCP CT role from 1.3 onwards. Also the assigned numbers page mention that AV Remote must appear before AV Remote Controller:

"The AVRCP specification v1.3 and later require that 0x110E also be included in the ServiceClassIDList before 0x110F for backwards compatibility."

---
 profiles/audio/avrcp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
profiles/audio/avrcp.c +3 -1
index b1b2ae6..296067c 100644
@@ -263,7 +263,7 @@ static void avrcp_register_notification(struct avrcp *session, uint8_t event);
 static sdp_record_t *avrcp_ct_record(void)
 {
 	sdp_list_t *svclass_id, *pfseq, *apseq, *apseq1, *root;
-	uuid_t root_uuid, l2cap, avctp, avrct;
+	uuid_t root_uuid, l2cap, avctp, avrct, avrctr;
 	sdp_profile_desc_t profile[1];
 	sdp_list_t *aproto, *aproto1, *proto[2], *proto1[2];
 	sdp_record_t *record;
@@ -287,6 +287,8 @@ static sdp_record_t *avrcp_ct_record(void)
 	/* Service Class ID List */
 	sdp_uuid16_create(&avrct, AV_REMOTE_SVCLASS_ID);
 	svclass_id = sdp_list_append(0, &avrct);
+	sdp_uuid16_create(&avrctr, AV_REMOTE_CONTROLLER_SVCLASS_ID);
+	svclass_id = sdp_list_append(svclass_id, &avrctr);
 	sdp_set_service_classes(record, svclass_id);
 
 	/* Protocol Descriptor List */
Signature · 1 line
1.8.3.1
author maintainer
#5 lore raw

PATCH 6/7 tools/sdptool: Fix parsing for service class 0x110f

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

According to assigned number 0x110f is AV Remote Controller not VCP.

---
 tools/sdptool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/sdptool.c +1 -2
index c241655..f985b1e 100644
@@ -286,7 +286,7 @@ static struct uuid_def uuid16_names[] = {
 	{ 0x110c, "RemoteControlTarget", NULL, 0 },
 	{ 0x110d, "AdvancedAudio", NULL, 0 },
 	{ 0x110e, "RemoteControl", NULL, 0 },
-	{ 0x110f, "VideoConferencing", NULL, 0 },
+	{ 0x110f, "RemoteControlController", NULL, 0 },
 	{ 0x1110, "Intercom", NULL, 0 },
 	{ 0x1111, "Fax", NULL, 0 },
 	{ 0x1112, "HeadsetAudioGateway", NULL, 0 },
@@ -316,7 +316,6 @@ static struct uuid_def uuid16_names[] = {
 	{ 0x1126, "HCR_Print (HCR)", NULL, 0 },
 	{ 0x1127, "HCR_Scan (HCR)", NULL, 0 },
 	{ 0x1128, "Common ISDN Access (CIP)", NULL, 0 },
-	{ 0x1129, "VideoConferencingGW (VCP)", NULL, 0 },
 	{ 0x112a, "UDI-MT", NULL, 0 },
 	{ 0x112b, "UDI-TA", NULL, 0 },
 	{ 0x112c, "Audio/Video", NULL, 0 },
Signature · 1 line
1.8.3.1
author maintainer
#6 lore raw

PATCH 7/7 tools/hcidump: Fix parsing for service class 0x110f

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

According to assigned number 0x110f is AV Remote Controller not VCP.

---
 tools/parser/sdp.c | 3 +--
 tools/parser/sdp.h | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
tools/parser/sdp.c +1 -2
index b48e3ff..29708e3 100644
@@ -121,7 +121,7 @@ static sdp_uuid_nam_lookup_table_t sdp_uuid_nam_lookup_table[] = {
 	{ SDP_UUID_AV_REMOTE_TARGET,         "AVRemTarget"  }, /* AVRCP */
 	{ SDP_UUID_ADVANCED_AUDIO,           "AdvAudio"     }, /* A2DP */
 	{ SDP_UUID_AV_REMOTE,                "AVRemote"     }, /* AVRCP */
-	{ SDP_UUID_VIDEO_CONFERENCING,       "VideoConf"    }, /* VCP */
+	{ SDP_UUID_AV_REMOTE,                "AVRemCt"      }, /* AVRCP */
 	{ SDP_UUID_INTERCOM,                 "Intercom"     },
 	{ SDP_UUID_FAX,                      "Fax"          },
 	{ SDP_UUID_HEADSET_AUDIO_GATEWAY,    "Headset AG"   },
@@ -145,7 +145,6 @@ static sdp_uuid_nam_lookup_table_t sdp_uuid_nam_lookup_table[] = {
 	{ SDP_UUID_HCR_PRINT,                "HCRPrint"     }, /* HCRP */
 	{ SDP_UUID_HCR_SCAN,                 "HCRScan"      }, /* HCRP */
 	{ SDP_UUID_COMMON_ISDN_ACCESS,       "CIP"          }, /* CIP */
-	{ SDP_UUID_VIDEO_CONFERENCING_GW,    "VideoConf GW" }, /* VCP */
 	{ SDP_UUID_UDI_MT,                   "UDI MT"       }, /* UDI */
 	{ SDP_UUID_UDI_TA,                   "UDI TA"       }, /* UDI */
 	{ SDP_UUID_AUDIO_VIDEO,              "AudioVideo"   }, /* VCP */
tools/parser/sdp.h +1 -2
index 41fc209..ed55a23 100644
@@ -66,7 +66,7 @@
 #define SDP_UUID_AV_REMOTE_TARGET                      0x110c /* AVRCP */
 #define SDP_UUID_ADVANCED_AUDIO                        0x110d /* A2DP */
 #define SDP_UUID_AV_REMOTE                             0x110e /* AVRCP */
-#define SDP_UUID_VIDEO_CONFERENCING                    0x110f /* VCP */
+#define SDP_UUID_AV_REMOTE_CONTROLLER                  0x110f /* AVRCP */
 #define SDP_UUID_INTERCOM                              0x1110
 #define SDP_UUID_FAX                                   0x1111
 #define SDP_UUID_HEADSET_AUDIO_GATEWAY                 0x1112
@@ -93,7 +93,6 @@
 #define SDP_UUID_HCR_PRINT                             0x1126 /* HCRP */
 #define SDP_UUID_HCR_SCAN                              0x1127 /* HCRP */
 #define SDP_UUID_COMMON_ISDN_ACCESS                    0x1128 /* CIP */
-#define SDP_UUID_VIDEO_CONFERENCING_GW                 0x1129 /* VCP */
 #define SDP_UUID_UDI_MT                                0x112a /* UDI */
 #define SDP_UUID_UDI_TA                                0x112b /* UDI */
 #define SDP_UUID_AUDIO_VIDEO                           0x112c /* VCP */
Signature · 1 line
1.8.3.1
#7 lore raw
In reply to Luiz Augusto von Dentz

Hi Luiz,

Quoted 6 lines · Luiz Augusto von Dentz

To be able to use OBEX over L2CAP the version number should be at least 0x102, in addition to that ERTM mode should be used to comply to GOEP 2.0.

---
 src/profile.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

All patches in this set have been applied. Thanks.

Johan