Module Name:    src
Committed By:   plunky
Date:           Sat Jul 25 17:32:47 UTC 2009

Modified Files:
        src/usr.bin/sdpquery: print.c

Log Message:
add new Service Class ID and Protocol UUIDs from the Service Discovery
assigned numbers document at www.bluetooth.com

add detail printing for Message Access Profile v1.0


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/sdpquery/print.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/sdpquery/print.c
diff -u src/usr.bin/sdpquery/print.c:1.2 src/usr.bin/sdpquery/print.c:1.3
--- src/usr.bin/sdpquery/print.c:1.2	Sat Jul  4 16:01:15 2009
+++ src/usr.bin/sdpquery/print.c	Sat Jul 25 17:32:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.2 2009/07/04 16:01:15 plunky Exp $	*/
+/*	$NetBSD: print.c,v 1.3 2009/07/25 17:32:47 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: print.c,v 1.2 2009/07/04 16:01:15 plunky Exp $");
+__RCSID("$NetBSD: print.c,v 1.3 2009/07/25 17:32:47 plunky Exp $");
 
 #include <ctype.h>
 #include <iconv.h>
@@ -73,6 +73,7 @@
 static bool print_service_attribute(uint16_t, sdp_data_t *);
 
 static void print_bool(sdp_data_t *);
+static void print_uint8d(sdp_data_t *);
 static void print_uint8x(sdp_data_t *);
 static void print_uint16d(sdp_data_t *);
 static void print_uint16x(sdp_data_t *);
@@ -108,6 +109,7 @@
 static void print_hfag_features(sdp_data_t *);
 static void print_net_access_type(sdp_data_t *);
 static void print_pnp_source(sdp_data_t *);
+static void print_mas_types(sdp_data_t *);
 
 static void print_rfcomm(sdp_data_t *);
 static void print_bnep(sdp_data_t *);
@@ -137,6 +139,8 @@
 	{ 0x0019, "AVDTP",				print_avdtp },
 	{ 0x001b, "CMTP",				NULL },
 	{ 0x001d, "UDI_C_PLANE",			NULL },
+	{ 0x001e, "MCAP_CONTROL_CHANNEL",		NULL },
+	{ 0x001f, "MCAP_DATA_CHANNEL",			NULL },
 	{ 0x0100, "L2CAP",				print_l2cap },
 };
 
@@ -269,6 +273,11 @@
 	{ 0x0205, "VendorIDSource",			print_pnp_source },
 };
 
+attr_t mas_attrs[] = {	/* Message Access Server */
+	{ 0x0315, "InstanceID",				print_uint8d },
+	{ 0x0316, "SupportedMessageTypes",		print_mas_types },
+};
+
 #define A(a)	a, __arraycount(a)
 service_t service_list[] = {
 	{ 0x1000, "Service Discovery Server",		A(sds_attrs) },
@@ -319,6 +328,13 @@
 	{ 0x112b, "UDI TA",				NULL, 0 },
 	{ 0x112c, "Audio/Video",			NULL, 0 },
 	{ 0x112d, "SIM Access",				NULL, 0 },
+	{ 0x112e, "Phonebook Access PCE",		NULL, 0 },
+	{ 0x112f, "Phonebook Access PSE",		NULL, 0 },
+	{ 0x1130, "Phonebook Access",			NULL, 0 },
+	{ 0x1131, "Headset HS",				NULL, 0 },
+	{ 0x1132, "Message Access Server",		A(mas_attrs) },
+	{ 0x1133, "Message Notification Server",	NULL, 0 },
+	{ 0x1134, "Message Access Profile",		NULL, 0 },
 	{ 0x1200, "PNP Information",			A(pnp_attrs) },
 	{ 0x1201, "Generic Networking",			NULL, 0 },
 	{ 0x1202, "Generic File Transfer",		NULL, 0 },
@@ -329,6 +345,12 @@
 	{ 0x1300, "UPNP IP PAN",			NULL, 0 },
 	{ 0x1301, "UPNP IP LAP",			NULL, 0 },
 	{ 0x1302, "UPNP IP L2CAP",			NULL, 0 },
+	{ 0x1303, "Video Source",			NULL, 0 },
+	{ 0x1304, "Video Sink",				NULL, 0 },
+	{ 0x1305, "Video Distribution",			NULL, 0 },
+	{ 0x1400, "HDP",				NULL, 0 },
+	{ 0x1401, "HDP Source",				NULL, 0 },
+	{ 0x1402, "HDP Sink",				NULL, 0 },
 };
 #undef A
 
@@ -583,6 +605,17 @@
 }
 
 static void
+print_uint8d(sdp_data_t *data)
+{
+	uint8_t v;
+
+	if (!sdp_get_uint8(data, &v))
+		return;
+
+	printf("%d\n", v);
+}
+
+static void
 print_uint8x(sdp_data_t *data)
 {
 	uint8_t v;
@@ -1274,6 +1307,24 @@
 }
 
 static void
+print_mas_types(sdp_data_t *data)
+{
+	uint8_t v;
+
+	if (!sdp_get_uint8(data, &v))
+		return;
+
+	if (Nflag)
+		printf("(0x%02x)", v);
+
+	printf("\n");
+	if (v & (1<<0))	printf("    EMAIL\n");
+	if (v & (1<<1))	printf("    SMS_GSM\n");
+	if (v & (1<<2))	printf("    SMS_CDMA\n");
+	if (v & (1<<3))	printf("    MMS\n");
+}
+
+static void
 print_rfcomm(sdp_data_t *data)
 {
 	uint8_t v;

Reply via email to