Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/3] android/socket: Add fake service for SDP testing
@ 2015-02-24 12:05 Szymon Janc
  2015-02-24 12:06 ` [PATCH 2/3] android/pts: Add PICS, PIXIT and initial SDP PTS tests results Szymon Janc
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Szymon Janc @ 2015-02-24 12:05 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

This adds fake L2CAP based service that adds SDP records required
for passing SDP qualification tests.

L2CAP sockets are currently not used in Android so it should be safe
to use it.
---
 android/socket.c | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 117 insertions(+), 1 deletion(-)

diff --git a/android/socket.c b/android/socket.c
index ec78dcd..15e1bfc 100644
--- a/android/socket.c
+++ b/android/socket.c
@@ -98,6 +98,10 @@ static GList *connections = NULL;
 
 static struct rfcomm_channel servers[RFCOMM_CHANNEL_MAX + 1];
 
+static uint32_t test_sdp_record_uuid16 = 0;
+static uint32_t test_sdp_record_uuid32 = 0;
+static uint32_t test_sdp_record_uuid128 = 0;
+
 static int rfsock_set_buffer(struct rfcomm_sock *rfsock)
 {
 	socklen_t len = sizeof(int);
@@ -878,6 +882,113 @@ failed:
 	return HAL_STATUS_FAILED;
 }
 
+static uint32_t add_test_record(uuid_t *uuid)
+{
+	sdp_record_t *record;
+	sdp_list_t *svclass_id;
+	sdp_list_t *seq, *pbg_seq, *proto_seq, *ap_seq;
+	sdp_list_t *proto, *proto1, *aproto;
+	uuid_t l2cap_uuid, pbg_uuid, ap_uuid;
+
+	record = sdp_record_alloc();
+	if (!record)
+		return 0;
+
+	record->handle =  sdp_next_handle();
+
+	svclass_id = sdp_list_append(NULL, uuid);
+	sdp_set_service_classes(record, svclass_id);
+
+	sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
+	proto = sdp_list_append(NULL, &l2cap_uuid);
+	seq = sdp_list_append(NULL, proto);
+
+	proto_seq = sdp_list_append(NULL, seq);
+	sdp_set_access_protos(record, proto_seq);
+
+	sdp_uuid16_create(&pbg_uuid, PUBLIC_BROWSE_GROUP);
+	pbg_seq = sdp_list_append(NULL, &pbg_uuid);
+	sdp_set_browse_groups(record, pbg_seq);
+
+	/* Additional Protocol Descriptor List */
+	sdp_uuid16_create(&ap_uuid, L2CAP_UUID);
+	proto1 = sdp_list_append(NULL, &ap_uuid);
+	ap_seq = sdp_list_append(NULL, proto1);
+	aproto = sdp_list_append(NULL, ap_seq);
+	sdp_set_add_access_protos(record, aproto);
+
+	sdp_set_service_id(record, *uuid);
+	sdp_set_record_state(record, 0);
+	sdp_set_service_ttl(record, 0);
+	sdp_set_service_avail(record, 0);
+	sdp_set_url_attr(record, "http://www.bluez.org",
+				"http://www.bluez.org", "http://www.bluez.org");
+
+	sdp_list_free(proto, NULL);
+	sdp_list_free(seq, NULL);
+	sdp_list_free(proto_seq, NULL);
+	sdp_list_free(pbg_seq, NULL);
+	sdp_list_free(svclass_id, NULL);
+
+	if (bt_adapter_add_record(record, 0) < 0) {
+		sdp_record_free(record);
+		return 0;
+	}
+
+	return record->handle;
+}
+
+static void test_sdp_cleanup(void)
+{
+	if (test_sdp_record_uuid16) {
+		bt_adapter_remove_record(test_sdp_record_uuid16);
+		test_sdp_record_uuid16 = 0;
+	}
+
+	if (test_sdp_record_uuid32) {
+		bt_adapter_remove_record(test_sdp_record_uuid32);
+		test_sdp_record_uuid32 = 0;
+	}
+
+	if (test_sdp_record_uuid128) {
+		bt_adapter_remove_record(test_sdp_record_uuid128);
+		test_sdp_record_uuid128 = 0;
+	}
+}
+
+static void test_sdp_init(void)
+{
+	char uuid128[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+				0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+	uuid_t u;
+
+	sdp_uuid16_create(&u, 0xffff);
+	test_sdp_record_uuid16 = add_test_record(&u);
+
+	sdp_uuid32_create(&u, 0xffffffff);
+	test_sdp_record_uuid32 = add_test_record(&u);
+
+	sdp_uuid128_create(&u, uuid128);
+	test_sdp_record_uuid128 = add_test_record(&u);
+}
+
+static uint8_t l2cap_listen(int chan, const uint8_t *name, const uint8_t *uuid,
+						uint8_t flags, int *hal_sock)
+{
+	/* TODO be more strict here? */
+	if (strcmp("BlueZ", (const char *) name)) {
+		error("socket: Only SDP test supported on L2CAP");
+		return HAL_STATUS_UNSUPPORTED;
+	}
+
+	test_sdp_cleanup();
+	test_sdp_init();
+
+	*hal_sock = -1;
+
+	return HAL_STATUS_SUCCESS;
+}
+
 static void handle_listen(const void *buf, uint16_t len)
 {
 	const struct hal_cmd_socket_listen *cmd = buf;
@@ -889,8 +1000,11 @@ static void handle_listen(const void *buf, uint16_t len)
 		status = rfcomm_listen(cmd->channel, cmd->name, cmd->uuid,
 							cmd->flags, &hal_sock);
 		break;
-	case HAL_SOCK_SCO:
 	case HAL_SOCK_L2CAP:
+		status = l2cap_listen(cmd->channel, cmd->name, cmd->uuid,
+							cmd->flags, &hal_sock);
+		break;
+	case HAL_SOCK_SCO:
 		status = HAL_STATUS_UNSUPPORTED;
 		break;
 	default:
@@ -1193,6 +1307,8 @@ void bt_socket_unregister(void)
 
 	DBG("");
 
+	test_sdp_cleanup();
+
 	g_list_free_full(connections, cleanup_rfsock);
 
 	for (ch = 0; ch <= RFCOMM_CHANNEL_MAX; ch++)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] android/pts: Add PICS, PIXIT and initial SDP PTS tests results
  2015-02-24 12:05 [PATCH 1/3] android/socket: Add fake service for SDP testing Szymon Janc
@ 2015-02-24 12:06 ` Szymon Janc
  2015-02-24 12:06 ` [PATCH 3/3] android/pts: Update " Szymon Janc
  2015-02-24 16:34 ` [PATCH 1/3] android/socket: Add fake service for SDP testing Szymon Janc
  2 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2015-02-24 12:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sebastian Chlad

From: Sebastian Chlad <sebastian.chlad@tieto.com>

This adds PTS 6.0 SDP test files.
---
 android/Makefile.am   |  2 ++
 android/pics-sdp.txt  | 81 ++++++++++++++++++++++++++-------------------------
 android/pixit-sdp.txt | 45 ++++++++++++++++++++++++++++
 android/pts-sdp.txt   | 19 ++++++++++++
 4 files changed, 108 insertions(+), 39 deletions(-)
 create mode 100644 android/pixit-sdp.txt
 create mode 100644 android/pts-sdp.txt

diff --git a/android/Makefile.am b/android/Makefile.am
index 3ea32e9..57c3733 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -284,6 +284,7 @@ EXTRA_DIST += android/Android.mk android/README \
 				android/pixit-spp.txt \
 				android/pixit-avdtp.txt \
 				android/pixit-gavdp.txt \
+				android/pixit-sdp.txt \
 				android/pts-rfcomm.txt \
 				android/pts-spp.txt \
 				android/pts-l2cap.txt \
@@ -310,3 +311,4 @@ EXTRA_DIST += android/Android.mk android/README \
 				android/pts-dis.txt \
 				android/pts-avdtp.txt \
 				android/pts-gavdp.txt
+				android/pts-sdp.txt
diff --git a/android/pics-sdp.txt b/android/pics-sdp.txt
index cb98130..9aae190 100644
--- a/android/pics-sdp.txt
+++ b/android/pics-sdp.txt
@@ -1,5 +1,8 @@
+SDP PICS for the PTS tool.
 
-* - different than BITE defaults
+PTS version: 6.0
+
+* - different than PTS defaults
 # - not yet implemented/supported
 
 M - mandatory
@@ -10,9 +13,9 @@ O - optional
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.1.1		True		Support for 128 bit UUID (M)
-E.1.2		True		Support for 32 bit UUID	(M)
-E.1.3		True		Support for 16 bit UUID (M)
+TSPC_SDP_1_1	True		Support for 128 bit UUID (M)
+TSPC_SDP_1_2	True		Support for 32 bit UUID	(M)
+TSPC_SDP_1_3	True		Support for 16 bit UUID (M)
 -------------------------------------------------------------------------------
 
 
@@ -20,8 +23,8 @@ E.1.3		True		Support for 16 bit UUID (M)
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.1b.1		True		Support for server role (C.1)
-E.1b.2		True		Support for client role (C.1)
+TSPC_SDP_1b_1	True (*)	Support for server role (C.1)
+TSPC_SDP_1b_2	True (*)	Support for client role (C.1)
 -------------------------------------------------------------------------------
 C.1 Mandatory to support at least one of the roles
 -------------------------------------------------------------------------------
@@ -31,11 +34,11 @@ C.1 Mandatory to support at least one of the roles
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.2.1		True		Support for respond on search of single
+TSPC_SDP_2_1	True (*)	Support for respond on search of single
 				Service, using ServiceSearchRequest (C.2)
-E.2.2		True		Support for respond on search of Service,
+TSPC_SDP_2_2	True (*)	Support for respond on search of Service,
 				using continuation state (O)
-E.2.3		True		Search for services using the continuation
+TSPC_SDP_2_3	True (*)	Search for services using the continuation
 				state (C.1)
 -------------------------------------------------------------------------------
 C.1 Mandatory to support if the client role is supported (1b/2)
@@ -47,7 +50,7 @@ C.2 Mandatory to support if the server role is supported (1b/1)
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.3.1		True		Support for error response on Service search
+TSPC_SDP_3_1	True		Support for error response on Service search
 				request (M)
 -------------------------------------------------------------------------------
 
@@ -56,11 +59,11 @@ E.3.1		True		Support for error response on Service search
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.4.1		True		Support for respond on search of
+TSPC_SDP_4_1	True		Support for respond on search of
 				Attribute(s) (M)
-E.4.2		True		Support for respond on search of
+TSPC_SDP_4_2	True (*)	Support for respond on search of
 				Attribute, using continuation state (O)
-E.4.3		True		Support for respond on search on
+TSPC_SDP_4_3	True (*)	Support for respond on search on
 				attribute AdditionalProtocolDescriptorList (O)
 -------------------------------------------------------------------------------
 
@@ -69,7 +72,7 @@ E.4.3		True		Support for respond on search on
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.5.1		True		Support for error response on Attribute
+TSPC_SDP_5_1	True		Support for error response on Attribute
 				search request (M)
 -------------------------------------------------------------------------------
 
@@ -78,11 +81,11 @@ E.5.1		True		Support for error response on Attribute
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.6.1		True		Support for respond on search for Service(s)
+TSPC_SDP_6_1	True		Support for respond on search for Service(s)
 				and Attribute(s) (M)
-E.6.2		True		Support for respond on search of Attribute,
+TSPC_SDP_6_2	True (*)	Support for respond on search of Attribute,
 				using continuation state (O)
-E.6.3		True		Support for respond on search on attribute
+TSPC_SDP_6_3	True (*)	Support for respond on search on attribute
 				AdditionalProtocolDescriptorList on existing
 				service (O)
 -------------------------------------------------------------------------------
@@ -92,7 +95,7 @@ E.6.3		True		Support for respond on search on attribute
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.7.1		True		Support for error response on Service and
+TSPC_SDP_7_1	True		Support for error response on Service and
 				Attribute request (M)
 -------------------------------------------------------------------------------
 
@@ -101,10 +104,10 @@ E.7.1		True		Support for error response on Service and
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.8.1		True		Support for browsing, using
+TSPC_SDP_8_1	True (*)	Support for browsing, using
 				SDP_ServiceSearchRequest and
 				SDP_ServiceAttributeRequest (O)
-E.8.2		True		Support for browsing, using
+TSPC_SDP_8_2	True (*)	Support for browsing, using
 				SDP_ServiceSearchAttributeRequest (O)
 -------------------------------------------------------------------------------
 
@@ -113,25 +116,25 @@ E.8.2		True		Support for browsing, using
 -------------------------------------------------------------------------------
 Item		Selected	Description
 -------------------------------------------------------------------------------
-E.9.1		True		ServiceID (O)
-E.9.2		True		ProtocolDescriptorList (O)
-E.9.3		True		ServiceRecordState (O)
-E.9.4		True		ServiceInfoTimeToLive (O)
-E.9.5		True		BrowseGroupList (O)
-E.9.6		True		LanguageBaseAttributeIdList (O)
-E.9.7		True		ServiceAvailability (O)
-E.9.8		True		IconURL (O)
-E.9.9		True		ServiceName (O)
-E.9.10		True		ServiceDescription (O)
-E.9.11		True		ProviderName (O)
-E.9.12		True		VersionNumberList (O)
-E.9.13		True		ServiceDataBaseState (O)
-E.9.14		True		BluetoothProfileDescriptorList (O)
-E.9.15		True		DocumentationURL (O)
-E.9.16		True		ClientExecutableURL (O)
-E.9.17		True		AdditionalProtocolDescriptorList (C.1)
-E.9.18		True		ServiceRecordHandle (M)
-E.9.19		True		ServiceClassIDList (M)
+TSPC_SDP_9_1	True (*)	ServiceID (O)
+TSPC_SDP_9_2	True (*)	ProtocolDescriptorList (O)
+TSPC_SDP_9_3	True (*)	ServiceRecordState (O)
+TSPC_SDP_9_4	True (*)	ServiceInfoTimeToLive (O)
+TSPC_SDP_9_5	True (*)	BrowseGroupList (O)
+TSPC_SDP_9_6	True (*)	LanguageBaseAttributeIdList (O)
+TSPC_SDP_9_7	True (*)	ServiceAvailability (O)
+TSPC_SDP_9_8	True (*)	IconURL (O)
+TSPC_SDP_9_9	True (*)	ServiceName (O)
+TSPC_SDP_9_10	True (*)	ServiceDescription (O)
+TSPC_SDP_9_11	True (*)	ProviderName (O)
+TSPC_SDP_9_12	True (*)	VersionNumberList (O)
+TSPC_SDP_9_13	True (*)	ServiceDataBaseState (O)
+TSPC_SDP_9_14	True (*)	BluetoothProfileDescriptorList (O)
+TSPC_SDP_9_15	True (*)	DocumentationURL (O)
+TSPC_SDP_9_16	True (*)	ClientExecutableURL (O)
+TSPC_SDP_9_17	True (*)	AdditionalProtocolDescriptorList (C.1)
+TSPC_SDP_9_18	True		ServiceRecordHandle (M)
+TSPC_SDP_9_19	True		ServiceClassIDList (M)
 -------------------------------------------------------------------------------
 C.1: Optional if 9/2 is supported, otherwise excluded
 -------------------------------------------------------------------------------
diff --git a/android/pixit-sdp.txt b/android/pixit-sdp.txt
new file mode 100644
index 0000000..80b5931
--- /dev/null
+++ b/android/pixit-sdp.txt
@@ -0,0 +1,45 @@
+SDP PIXIT for the PTS tool.
+
+PTS version: 6.0
+
+* - different than PTS defaults
+& - should be set to IUT Bluetooth address
+^ - should be set accordingly
+# - should be set according to the reported phone number's type
+
+		Required PIXIT settings
+-------------------------------------------------------------------------------
+Parameter Name							Value
+-------------------------------------------------------------------------------
+TSPX_sdp_service_search_pattern					0100
+TSPX_sdp_service_search_pattern_no_results			EEEE
+TSPX_sdp_service_search_additional_protocol_descriptor_list
+TSPX_sdp_service_search_bluetooth_profile_descriptor_list
+TSPX_sdp_service_search_pattern_browse_group_list
+TSPX_sdp_service_search_pattern_client_exe_url
+TSPX_sdp_service_search_pattern_documentation_url
+TSPX_sdp_service_search_pattern_icon_url
+TSPX_sdp_service_search_pattern_language_base_attribute_id_list
+TSPX_sdp_service_search_pattern_protocol_descriptor_list
+TSPX_sdp_service_search_pattern_provider_name
+TSPX_sdp_service_search_pattern_service_availability
+TSPX_sdp_service_search_pattern_service_data_base_state
+TSPX_sdp_service_search_pattern_service_description
+TSPX_sdp_service_search_pattern_service_id
+TSPX_sdp_service_search_pattern_service_info_time_to_live
+TSPX_sdp_service_search_pattern_version_number_list
+TSPX_sdp_service_search_pattern_service_name
+TSPX_sdp_service_search_pattern_service_record_state
+TSPX_sdp_unsupported_attribute_id
+TSPX_security_enabled						FALSE
+TSPX_delete_link_key						FALSE
+TSPX_bd_addr_iut						112233445566(*&)
+TSPX_class_of_device_pts					200404
+TSPX_class_of_device_test_pts_initiator				TRUE
+TSPX_limited_inquiry_used					FALSE
+TSPX_pin_code							0000
+TSPX_time_guard							200000
+TSPX_device_search_time						20
+TSPX_use_implicit_send						TRUE
+TSPX_secure_simple_pairing_pass_key_confirmation		FALSE
+-------------------------------------------------------------------------------
diff --git a/android/pts-sdp.txt b/android/pts-sdp.txt
new file mode 100644
index 0000000..1e29152
--- /dev/null
+++ b/android/pts-sdp.txt
@@ -0,0 +1,19 @@
+PTS test results for SDP
+
+PTS version: 6.0
+Tested: 16-December-2014
+Android version: 5.0
+
+Results:
+PASS	test passed
+FAIL	test failed
+INC	test is inconclusive
+N/A	test is disabled due to PICS setup
+NONE	test result is none
+
+-------------------------------------------------------------------------------
+Test Name				Result	Notes
+-------------------------------------------------------------------------------
+TC_SERVER_BRW_BV_01_C			PASS
+TC_SERVER_BRW_BV_01_C			PASS
+-------------------------------------------------------------------------------
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] android/pts: Update SDP PTS tests results
  2015-02-24 12:05 [PATCH 1/3] android/socket: Add fake service for SDP testing Szymon Janc
  2015-02-24 12:06 ` [PATCH 2/3] android/pts: Add PICS, PIXIT and initial SDP PTS tests results Szymon Janc
@ 2015-02-24 12:06 ` Szymon Janc
  2015-02-24 16:34 ` [PATCH 1/3] android/socket: Add fake service for SDP testing Szymon Janc
  2 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2015-02-24 12:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

---
 android/pixit-sdp.txt |  4 ++--
 android/pts-sdp.txt   | 66 +++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 64 insertions(+), 6 deletions(-)

diff --git a/android/pixit-sdp.txt b/android/pixit-sdp.txt
index 80b5931..2875256 100644
--- a/android/pixit-sdp.txt
+++ b/android/pixit-sdp.txt
@@ -23,11 +23,11 @@ TSPX_sdp_service_search_pattern_language_base_attribute_id_list
 TSPX_sdp_service_search_pattern_protocol_descriptor_list
 TSPX_sdp_service_search_pattern_provider_name
 TSPX_sdp_service_search_pattern_service_availability
-TSPX_sdp_service_search_pattern_service_data_base_state
+TSPX_sdp_service_search_pattern_service_data_base_state		1000(*)
 TSPX_sdp_service_search_pattern_service_description
 TSPX_sdp_service_search_pattern_service_id
 TSPX_sdp_service_search_pattern_service_info_time_to_live
-TSPX_sdp_service_search_pattern_version_number_list
+TSPX_sdp_service_search_pattern_version_number_list		1000(*)
 TSPX_sdp_service_search_pattern_service_name
 TSPX_sdp_service_search_pattern_service_record_state
 TSPX_sdp_unsupported_attribute_id
diff --git a/android/pts-sdp.txt b/android/pts-sdp.txt
index 1e29152..592306e 100644
--- a/android/pts-sdp.txt
+++ b/android/pts-sdp.txt
@@ -1,7 +1,7 @@
 PTS test results for SDP
 
 PTS version: 6.0
-Tested: 16-December-2014
+Tested: 23-February-2015
 Android version: 5.0
 
 Results:
@@ -11,9 +11,67 @@ INC	test is inconclusive
 N/A	test is disabled due to PICS setup
 NONE	test result is none
 
+Note: from haltest:
+bluetooth set_adapter_property BT_PROPERTY_ADAPTER_SCAN_MODE
+						BT_SCAN_MODE_CONNECTABLE
+bluetooth enable
+socket listen BTSOCK_L2CAP BlueZ 0
+
 -------------------------------------------------------------------------------
-Test Name				Result	Notes
+Test Name			Result	Notes
 -------------------------------------------------------------------------------
-TC_SERVER_BRW_BV_01_C			PASS
-TC_SERVER_BRW_BV_01_C			PASS
+TC_SERVER_BRW_BV_01_C		PASS
+TC_SERVER_BRW_BV_01_C		PASS
+TC_SERVER_SA_BI_01_C		PASS
+TC_SERVER_SA_BI_02_C		PASS
+TC_SERVER_SA_BI_03_C		PASS
+TC_SERVER_SA_BV_01_C		PASS
+TC_SERVER_SA_BV_03_C		PASS
+TC_SERVER_SA_BV_04_C		PASS
+TC_SERVER_SA_BV_05_C		PASS
+TC_SERVER_SA_BV_06_C		PASS
+TC_SERVER_SA_BV_07_C		PASS
+TC_SERVER_SA_BV_08_C		PASS
+TC_SERVER_SA_BV_09_C		PASS
+TC_SERVER_SA_BV_10_C		PASS
+TC_SERVER_SA_BV_11_C		PASS
+TC_SERVER_SA_BV_12_C		PASS
+TC_SERVER_SA_BV_13_C		PASS
+TC_SERVER_SA_BV_14_C		PASS
+TC_SERVER_SA_BV_15_C		PASS
+TC_SERVER_SA_BV_16_C		PASS
+TC_SERVER_SA_BV_17_C		PASS
+TC_SERVER_SA_BV_18_C		PASS
+TC_SERVER_SA_BV_19_C		PASS
+TC_SERVER_SA_BV_20_C		PASS
+TC_SERVER_SA_BV_21_C		PASS
+TC_SERVER_SS_BI_01_C		PASS
+TC_SERVER_SS_BI_02_C		PASS
+TC_SERVER_SS_BV_01_C		PASS
+TC_SERVER_SS_BV_03_C		PASS	PTS issue #12840
+TC_SERVER_SS_BV_04_C		PASS
+TC_SERVER_SSA_BI_01_C		PASS
+TC_SERVER_SSA_BI_02_C		PASS
+TC_SERVER_SSA_BV_01_C		PASS
+TC_SERVER_SSA_BV_02_C		PASS
+TC_SERVER_SSA_BV_03_C		PASS
+TC_SERVER_SSA_BV_04_C		PASS
+TC_SERVER_SSA_BV_06_C		PASS
+TC_SERVER_SSA_BV_07_C		PASS
+TC_SERVER_SSA_BV_08_C		PASS
+TC_SERVER_SSA_BV_09_C		PASS
+TC_SERVER_SSA_BV_10_C		PASS
+TC_SERVER_SSA_BV_11_C		PASS
+TC_SERVER_SSA_BV_12_C		PASS
+TC_SERVER_SSA_BV_13_C		PASS
+TC_SERVER_SSA_BV_14_C		PASS
+TC_SERVER_SSA_BV_15_C		PASS
+TC_SERVER_SSA_BV_16_C		PASS
+TC_SERVER_SSA_BV_17_C		PASS
+TC_SERVER_SSA_BV_18_C		PASS
+TC_SERVER_SSA_BV_19_C		PASS
+TC_SERVER_SSA_BV_20_C		PASS
+TC_SERVER_SSA_BV_21_C		PASS
+TC_SERVER_SSA_BV_22_C		PASS
+TC_SERVER_SSA_BV_23_C		PASS
 -------------------------------------------------------------------------------
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] android/socket: Add fake service for SDP testing
  2015-02-24 12:05 [PATCH 1/3] android/socket: Add fake service for SDP testing Szymon Janc
  2015-02-24 12:06 ` [PATCH 2/3] android/pts: Add PICS, PIXIT and initial SDP PTS tests results Szymon Janc
  2015-02-24 12:06 ` [PATCH 3/3] android/pts: Update " Szymon Janc
@ 2015-02-24 16:34 ` Szymon Janc
  2 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2015-02-24 16:34 UTC (permalink / raw)
  To: linux-bluetooth

On Tuesday 24 of February 2015 13:05:59 Szymon Janc wrote:
> This adds fake L2CAP based service that adds SDP records required
> for passing SDP qualification tests.
> 
> L2CAP sockets are currently not used in Android so it should be safe
> to use it.
> ---
>  android/socket.c | 118
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 117
> insertions(+), 1 deletion(-)
> 
> diff --git a/android/socket.c b/android/socket.c
> index ec78dcd..15e1bfc 100644
> --- a/android/socket.c
> +++ b/android/socket.c
> @@ -98,6 +98,10 @@ static GList *connections = NULL;
> 
>  static struct rfcomm_channel servers[RFCOMM_CHANNEL_MAX + 1];
> 
> +static uint32_t test_sdp_record_uuid16 = 0;
> +static uint32_t test_sdp_record_uuid32 = 0;
> +static uint32_t test_sdp_record_uuid128 = 0;
> +
>  static int rfsock_set_buffer(struct rfcomm_sock *rfsock)
>  {
>  	socklen_t len = sizeof(int);
> @@ -878,6 +882,113 @@ failed:
>  	return HAL_STATUS_FAILED;
>  }
> 
> +static uint32_t add_test_record(uuid_t *uuid)
> +{
> +	sdp_record_t *record;
> +	sdp_list_t *svclass_id;
> +	sdp_list_t *seq, *pbg_seq, *proto_seq, *ap_seq;
> +	sdp_list_t *proto, *proto1, *aproto;
> +	uuid_t l2cap_uuid, pbg_uuid, ap_uuid;
> +
> +	record = sdp_record_alloc();
> +	if (!record)
> +		return 0;
> +
> +	record->handle =  sdp_next_handle();
> +
> +	svclass_id = sdp_list_append(NULL, uuid);
> +	sdp_set_service_classes(record, svclass_id);
> +
> +	sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
> +	proto = sdp_list_append(NULL, &l2cap_uuid);
> +	seq = sdp_list_append(NULL, proto);
> +
> +	proto_seq = sdp_list_append(NULL, seq);
> +	sdp_set_access_protos(record, proto_seq);
> +
> +	sdp_uuid16_create(&pbg_uuid, PUBLIC_BROWSE_GROUP);
> +	pbg_seq = sdp_list_append(NULL, &pbg_uuid);
> +	sdp_set_browse_groups(record, pbg_seq);
> +
> +	/* Additional Protocol Descriptor List */
> +	sdp_uuid16_create(&ap_uuid, L2CAP_UUID);
> +	proto1 = sdp_list_append(NULL, &ap_uuid);
> +	ap_seq = sdp_list_append(NULL, proto1);
> +	aproto = sdp_list_append(NULL, ap_seq);
> +	sdp_set_add_access_protos(record, aproto);
> +
> +	sdp_set_service_id(record, *uuid);
> +	sdp_set_record_state(record, 0);
> +	sdp_set_service_ttl(record, 0);
> +	sdp_set_service_avail(record, 0);
> +	sdp_set_url_attr(record, "http://www.bluez.org",
> +				"http://www.bluez.org", "http://www.bluez.org");
> +
> +	sdp_list_free(proto, NULL);
> +	sdp_list_free(seq, NULL);
> +	sdp_list_free(proto_seq, NULL);
> +	sdp_list_free(pbg_seq, NULL);
> +	sdp_list_free(svclass_id, NULL);
> +
> +	if (bt_adapter_add_record(record, 0) < 0) {
> +		sdp_record_free(record);
> +		return 0;
> +	}
> +
> +	return record->handle;
> +}
> +
> +static void test_sdp_cleanup(void)
> +{
> +	if (test_sdp_record_uuid16) {
> +		bt_adapter_remove_record(test_sdp_record_uuid16);
> +		test_sdp_record_uuid16 = 0;
> +	}
> +
> +	if (test_sdp_record_uuid32) {
> +		bt_adapter_remove_record(test_sdp_record_uuid32);
> +		test_sdp_record_uuid32 = 0;
> +	}
> +
> +	if (test_sdp_record_uuid128) {
> +		bt_adapter_remove_record(test_sdp_record_uuid128);
> +		test_sdp_record_uuid128 = 0;
> +	}
> +}
> +
> +static void test_sdp_init(void)
> +{
> +	char uuid128[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> +				0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> +	uuid_t u;
> +
> +	sdp_uuid16_create(&u, 0xffff);
> +	test_sdp_record_uuid16 = add_test_record(&u);
> +
> +	sdp_uuid32_create(&u, 0xffffffff);
> +	test_sdp_record_uuid32 = add_test_record(&u);
> +
> +	sdp_uuid128_create(&u, uuid128);
> +	test_sdp_record_uuid128 = add_test_record(&u);
> +}
> +
> +static uint8_t l2cap_listen(int chan, const uint8_t *name, const uint8_t
> *uuid, +						uint8_t flags, int *hal_sock)
> +{
> +	/* TODO be more strict here? */
> +	if (strcmp("BlueZ", (const char *) name)) {
> +		error("socket: Only SDP test supported on L2CAP");
> +		return HAL_STATUS_UNSUPPORTED;
> +	}
> +
> +	test_sdp_cleanup();
> +	test_sdp_init();
> +
> +	*hal_sock = -1;
> +
> +	return HAL_STATUS_SUCCESS;
> +}
> +
>  static void handle_listen(const void *buf, uint16_t len)
>  {
>  	const struct hal_cmd_socket_listen *cmd = buf;
> @@ -889,8 +1000,11 @@ static void handle_listen(const void *buf, uint16_t
> len) status = rfcomm_listen(cmd->channel, cmd->name, cmd->uuid,
>  							cmd->flags, &hal_sock);
>  		break;
> -	case HAL_SOCK_SCO:
>  	case HAL_SOCK_L2CAP:
> +		status = l2cap_listen(cmd->channel, cmd->name, cmd->uuid,
> +							cmd->flags, &hal_sock);
> +		break;
> +	case HAL_SOCK_SCO:
>  		status = HAL_STATUS_UNSUPPORTED;
>  		break;
>  	default:
> @@ -1193,6 +1307,8 @@ void bt_socket_unregister(void)
> 
>  	DBG("");
> 
> +	test_sdp_cleanup();
> +
>  	g_list_free_full(connections, cleanup_rfsock);
> 
>  	for (ch = 0; ch <= RFCOMM_CHANNEL_MAX; ch++)

Applied.

-- 
BR
Szymon Janc

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-24 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 12:05 [PATCH 1/3] android/socket: Add fake service for SDP testing Szymon Janc
2015-02-24 12:06 ` [PATCH 2/3] android/pts: Add PICS, PIXIT and initial SDP PTS tests results Szymon Janc
2015-02-24 12:06 ` [PATCH 3/3] android/pts: Update " Szymon Janc
2015-02-24 16:34 ` [PATCH 1/3] android/socket: Add fake service for SDP testing Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox