* [PATCH v2 2/4] android/bluetooth: Register SDP record for MPS
2014-05-23 15:11 [PATCH v2 1/4] lib/sdp: Add attributes and service class for MPS Szymon Janc
@ 2014-05-23 15:11 ` Szymon Janc
2014-05-23 15:11 ` [PATCH v2 3/4] android/pics: Enable NAP and PBAP in MPS settings Szymon Janc
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Szymon Janc @ 2014-05-23 15:11 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
This was affecting TC_AG_SRC_HFAV_ACT_SD_BV_01_I and
TC_SDP_CTH_SD_BV_01_I PTS qualification tests.
---
android/bluetooth.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)
diff --git a/android/bluetooth.c b/android/bluetooth.c
index 93b9cd7..68a11c7 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -53,6 +53,40 @@
#include "utils.h"
#include "bluetooth.h"
+/*
+ * bits in bitmask as defined in table 6.3 of Multi Profile Specification
+ * HFP AG + A2DP SRC + AVRCP TG + PAN (NAP/PANU) + PBAP PSE
+ */
+#define MPS_DEFAULT_MPSD ((1ULL << 0) | (1ULL << 2) | (1ULL << 4) | \
+ (1ULL << 6) | (1ULL << 8) | (1ULL << 10) | \
+ (1ULL << 12) | (1ULL << 26) | (1ULL << 28) | \
+ (1ULL << 30) | (1ULL << 32) | (1ULL << 34) | \
+ (1ULL << 36))
+
+/*
+ * bits in bitmask as defined in table 6.4 of Multi Profile Specification
+ * HFP AG + A2DP SRC + AVRCP TG + PAN (NAP/PANU) + PBAP PSE
+ */
+#define MPS_DEFAULT_MPMD ((1ULL << 1) | (1ULL << 3) | (1ULL << 5) | \
+ (1ULL << 6) | (1ULL << 8) | (1ULL << 10) | \
+ (1ULL << 12) | (1ULL << 15) | (1ULL << 18))
+
+/*
+ * bits in bitmask as defined in table 6.5 of Multi Profile Specification
+ * Note that in this table spec starts bit positions from 1 (bit 0 unused?)
+ */
+#define MPS_DEFAULT_DEPS ((1 << 1) | (1 << 2) | (1 << 3))
+
+/* MPSD bit dependent on HFP AG support */
+#define MPS_MPSD_HFP_AG_DEP ((1ULL << 0) | (1ULL << 2) | (1ULL << 4) | \
+ (1ULL << 6) | (1ULL << 8) | (1ULL << 10) | \
+ (1ULL << 12) | (1ULL << 14) | (1ULL << 16) | \
+ (1ULL << 18) | (1ULL << 26) | (1ULL << 28) | \
+ (1ULL << 30))
+
+/* MPMD bit dependent on HFP AG support */
+#define MPS_MPMD_HFP_AG_DEP (1ULL << 6)
+
#define DEFAULT_ADAPTER_NAME "BlueZ for Android"
#define DUT_MODE_FILE "/sys/kernel/debug/bluetooth/hci%u/dut_mode"
@@ -2499,6 +2533,77 @@ static void set_adapter_class(void)
error("Failed to set class of device");
}
+static sdp_record_t *mps_record(void)
+{
+ sdp_data_t *mpsd_features, *mpmd_features, *dependencies;
+ sdp_list_t *svclass_id, *pfseq, *root;
+ uuid_t root_uuid, svclass_uuid;
+ sdp_profile_desc_t profile;
+ sdp_record_t *record;
+ uint64_t mpsd_feat, mpmd_feat;
+ uint16_t deps;
+
+ record = sdp_record_alloc();
+ if (!record)
+ return NULL;
+
+ sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
+ root = sdp_list_append(NULL, &root_uuid);
+ sdp_set_browse_groups(record, root);
+
+ sdp_uuid16_create(&svclass_uuid, MPS_SVCLASS_ID);
+ svclass_id = sdp_list_append(NULL, &svclass_uuid);
+ sdp_set_service_classes(record, svclass_id);
+
+ sdp_uuid16_create(&profile.uuid, MPS_PROFILE_ID);
+ profile.version = 0x0100;
+ pfseq = sdp_list_append(NULL, &profile);
+ sdp_set_profile_descs(record, pfseq);
+
+ mpsd_feat = MPS_DEFAULT_MPSD;
+ mpmd_feat = MPS_DEFAULT_MPMD;
+
+ /* TODO should be configurable based on HFP AG support */
+ if (false) {
+ mpsd_feat &= MPS_MPSD_HFP_AG_DEP;
+ mpmd_feat &= MPS_MPMD_HFP_AG_DEP;
+ }
+
+ mpsd_features = sdp_data_alloc(SDP_UINT64, &mpsd_feat);
+ sdp_attr_add(record, SDP_ATTR_MPSD_SCENARIOS, mpsd_features);
+
+ mpmd_features = sdp_data_alloc(SDP_UINT64, &mpmd_feat);
+ sdp_attr_add(record, SDP_ATTR_MPMD_SCENARIOS, mpmd_features);
+
+ deps = MPS_DEFAULT_DEPS;
+ dependencies = sdp_data_alloc(SDP_UINT16, &deps);
+ sdp_attr_add(record, SDP_ATTR_MPS_DEPENDENCIES, dependencies);
+
+ sdp_set_info_attr(record, "Multi Profile", 0, 0);
+
+ sdp_list_free(pfseq, NULL);
+ sdp_list_free(root, NULL);
+ sdp_list_free(svclass_id, NULL);
+
+ return record;
+}
+
+static void add_mps_record(void)
+{
+ sdp_record_t *rec;
+
+ rec = mps_record();
+ if (!rec) {
+ error("Failed to allocate MPS record");
+ return;
+ }
+
+ if (bt_adapter_add_record(rec, 0) < 0) {
+ error("Failed to register MPS record");
+ sdp_record_free(rec);
+ }
+}
+
static void read_info_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
@@ -2559,6 +2664,7 @@ static void read_info_complete(uint8_t status, uint16_t length,
set_io_capability();
set_device_id();
+ add_mps_record();
missing_settings = adapter.current_settings ^
adapter.supported_settings;
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v2 3/4] android/pics: Enable NAP and PBAP in MPS settings
2014-05-23 15:11 [PATCH v2 1/4] lib/sdp: Add attributes and service class for MPS Szymon Janc
2014-05-23 15:11 ` [PATCH v2 2/4] android/bluetooth: Register SDP record " Szymon Janc
@ 2014-05-23 15:11 ` Szymon Janc
2014-05-23 15:11 ` [PATCH v2 4/4] android/pts: Update MPS tests results Szymon Janc
2014-05-26 9:11 ` [PATCH v2 1/4] lib/sdp: Add attributes and service class for MPS Szymon Janc
3 siblings, 0 replies; 5+ messages in thread
From: Szymon Janc @ 2014-05-23 15:11 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
---
android/pics-mps.txt | 32 ++++++++++++++++----------------
android/pixit-mps.txt | 2 +-
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/android/pics-mps.txt b/android/pics-mps.txt
index e12cad0..5cbe1d8 100644
--- a/android/pics-mps.txt
+++ b/android/pics-mps.txt
@@ -24,8 +24,8 @@ TSPC_MPS_1_1 True (*) A2DP 1.2 or later (O)
TSPC_MPS_1_2 True (*) AVRCP 1.3 or later (O)
TSPC_MPS_1_3 False DUN 1.1 or later (O)
TSPC_MPS_1_4 True (*) HFP 1.5 or later (O)
-TSPC_MPS_1_5 False PAN 1.0 or later (O)
-TSPC_MPS_1_6 False PBAP 1.1 or later (O)
+TSPC_MPS_1_5 True (*) PAN 1.0 or later (O)
+TSPC_MPS_1_6 True (*) PBAP 1.1 or later (O)
-------------------------------------------------------------------------------
@@ -41,11 +41,11 @@ TSPC_MPS_2_5 False DUN Gateway (GW) (C.1)
TSPC_MPS_2_6 False DUN Data Terminal (DT) (C.1)
TSPC_MPS_2_7 True (*) HFP Audio Gateway (AG) (C.1)
TSPC_MPS_2_8 False HFP Hands-Free (HF) (C.1)
-TSPC_MPS_2_9 False PAN Network Access Point (NAP) (C.1)
+TSPC_MPS_2_9 True (*) PAN Network Access Point (NAP) (C.1)
TSPC_MPS_2_10 False PAN Group Ad-hoc Network (GN) (C.1)
-TSPC_MPS_2_11 False PAN User (PANU) (C.1)
+TSPC_MPS_2_11 True (*) PAN User (PANU) (C.1)
TSPC_MPS_2_12 False PBAP PCE (C.1)
-TSPC_MPS_2_13 False PBAP PSE (C.1)
+TSPC_MPS_2_13 True (*) PBAP PSE (C.1)
-------------------------------------------------------------------------------
C.1: Mandatory to declare each role as supported within the represented Profile
otherwise Excluded. The roles declared shall match that of the roles
@@ -77,10 +77,10 @@ TSPC_MPS_3_9 False Place a call with a phone number supplied by
the HF (C.6)
TSPC_MPS_3_10 True (*) Register Notification: PLAYBACK_STATUS_CHANGED
(C.7)
-TSPC_MPS_3_11 False Ability to support parallel data and call
+TSPC_MPS_3_11 True (*) Ability to support parallel data and call
operation (O)
-TSPC_MPS_3_12 False PBAP Phone Book Download (C.8)
-TSPC_MPS_3_13 False Ability to support multiple concurrent device
+TSPC_MPS_3_12 True (*) PBAP Phone Book Download (C.8)
+TSPC_MPS_3_13 True (*) Ability to support multiple concurrent device
connections (O)
-------------------------------------------------------------------------------
C.1: Mandatory if TSPC_MPS_2_1 (A2DP Source role) and TSPC_MPS_2_4 (AVRCP
@@ -109,7 +109,7 @@ C.8: Mandatory if TSPC_MPS_1_6 (PBAP 1.1 or later) and PBAP 2/1 (Phone Book
Parameter Name Selected Description
-------------------------------------------------------------------------------
TSPC_MPS_4_1 True Multiple Profiles Single Device (MPSD) (M)
-TSPC_MPS_4_2 False Multiple Profiles Multiple Devices (MPMD) (C.1)
+TSPC_MPS_4_2 True (*) Multiple Profiles Multiple Devices (MPMD) (C.1)
-------------------------------------------------------------------------------
C.1: Mandatory if TSPC_MPS_3_13 (Ability to support multiple concurrent device
connections), otherwise Excluded.
@@ -184,41 +184,41 @@ TSPC_MPS_6_25 False HFP-AG and DUN-GW Implementation Terminate
TSPC_MPS_6_26 False HFP-HF and DUN-DT Implementation Terminate
Voice Call/Data Call during Data Communication
and Voice Call (C.6)
-TSPC_MPS_6_27 False HFP-AG and PAN-NAP Implementation Data
+TSPC_MPS_6_27 True (*) HFP-AG and PAN-NAP Implementation Data
Communication in Personal Area Network during
Active Voice Call (C.7)
TSPC_MPS_6_28 False HFP-HF and PAN-PANU Implementation Data
Communication in Personal Area Network during
Active Voice Call (C.8)
-TSPC_MPS_6_29 False HFP-AG and PAN-NAP Implementation Outgoing
+TSPC_MPS_6_29 True (*) HFP-AG and PAN-NAP Implementation Outgoing
Voice Call during Data Communication in Personal
Area Network (C.7)
TSPC_MPS_6_30 False HFP-HF and PAN-PANU Implementation Outgoing
Voice Call during Data Communication in Personal
Area Network (C.8)
-TSPC_MPS_6_31 False HFP-AG and PAN-NAP Implementation Incoming Voice
+TSPC_MPS_6_31 True (*) HFP-AG and PAN-NAP Implementation Incoming Voice
Call during Data Communication in Personal Area
Network (C.7)
TSPC_MPS_6_32 False HFP-HF and PAN-PANU Implementation Incoming
Voice Call during Data Communication in Personal
Area Network (C.8)
-TSPC_MPS_6_33 False A2DP-SRC and PAN-NAP Implementation Start Audio
+TSPC_MPS_6_33 True (*) A2DP-SRC and PAN-NAP Implementation Start Audio
Streaming during Data Communication in Personal
Area Network (C.9)
TSPC_MPS_6_34 False A2DP-SNK and PAN-PANU Implementation Start Audio
Streaming during Data Communication in Personal
Area Network (C.10)
-TSPC_MPS_6_35 False A2DP-SRC and PAN-NAP Implementation Data
+TSPC_MPS_6_35 True (*) A2DP-SRC and PAN-NAP Implementation Data
Communication Establishment in Personal Area
Network during Audio Streaming (C.9)
TSPC_MPS_6_36 False A2DP-SNK and PAN_PANU Implementation Data
Communication Establishment in Personal Area
Network during Audio Streaming (C.10)
-TSPC_MPS_6_37 False A2DP-SRC_PBAP-Server Implementation Phonebook
+TSPC_MPS_6_37 True (*) A2DP-SRC_PBAP-Server Implementation Phonebook
Download during Audio Streaming (C.11)
TSPC_MPS_6_38 False A2DP-SNK and PBAP-Client Implementation
Phonebook Download during Audio Streaming (C.12)
-TSPC_MPS_6_39 False HFP-AG and PBAP-Server Implementation PBAP and
+TSPC_MPS_6_39 True (*) HFP-AG and PBAP-Server Implementation PBAP and
HFP Connection Behavior (C.13)
-------------------------------------------------------------------------------
C.1: Mandatory if 2/1 (A2DP Source role), 2/4 (AVRCP Target role) and 2/7
diff --git a/android/pixit-mps.txt b/android/pixit-mps.txt
index 317a391..e3c8096 100644
--- a/android/pixit-mps.txt
+++ b/android/pixit-mps.txt
@@ -14,7 +14,7 @@ TSPX_avrcp_revision 1.5 (^)
TSPX_class_of_device 20050C
TSPX_establish_avdtp_stream TRUE
TSPX_iut_establishes_initial_condition FALSE
-TSPX_tester_device
+TSPX_tester_device A (*)
TSPX_media_directory
TSPX_bd_addr_iut 112233445566 (*&)
TSPX_delete_link_key FALSE
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread