Linux bluetooth development
 help / color / mirror / Atom feed
* Re: Passive scanning of iBeacons results in a "Data Buffer Overflow"
From: Adam Warski @ 2014-03-05 20:41 UTC (permalink / raw)
  To: Anderson Lizardo; +Cc: BlueZ development
In-Reply-To: <CAJdJm_MXR08tvceb0-vHT=VD+dKY_dz2MbkO3eaUoBneeFxXMA@mail.gmail.com>

Hello,

I recompiled the kernel with dynamic debug, and here are the two files as per your instructions:
http://www.warski.org/ibeacons/dmesg.txt
http://www.warski.org/ibeacons/lescan.dump

I also tried another thing. I have two kinds of beacons: one coming from Estimote, the other from Qualcomm (Gimbal).

The Estimote beacons broadcast the advertisement packets with the same source address (well, it changes, but rarely). Hence to get all the packets the --duplicates flag is needed.

The Gimbal beacons broadcast with a different source address every time (random address). Hence to get all the packets the duplicate flag isn’t needed, as every packet is different.

Both transmit at a similar rate (maybe the Gimbals are a bit slower, but I also tried decreasing the scanning interval in hcitool), and with the Gimbal beacons the are no problems. So I guess this puts more doubt on possible USB cause? (and I checked the USB hub, it works fine as far as I can tell)

The root cause must be something with the usage of the --duplicates flag, no? Though I can’t find the code that it is handling the buffering - is it done on the dongle itself?

Adam

On 04 Mar 2014, at 00:07, Anderson Lizardo <anderson.lizardo@openbossa.org> wrote:

> Hi Adam,
> 
> On Mon, Mar 3, 2014 at 5:25 PM, Adam Warski <adam@warski.org> wrote:
>> But I guess even if it was a USB issue, it would be caught earlier? The advertisement packets have a certain preamble, and a CRC, so the shifted data would be discarded? Anyway, that doesn't seem to be the cause.
> 
> There are are a few things that point out to USB issue (in my opinion):
> 
> 1) You said that having ethernet cable connected or not modifies the
> behavior. on RPI, the ethernet chip is attached to the USB. As I said,
> strange things happen to me as well when not using powered USB hub
> (specially with WiFi dongles and USB cameras) :)
> 
> 2) As you noticed, the "truncated" adv. packet is not being discarded
> by the controller as we would expect. This means that the BT
> controller is actually receiving a correct packet, but it is being
> "truncated" when being sent to the host. The CRC/preamble, after
> parsed and verified by the BT controller, is removed before sending
> the packet to the host, so there is no way for the host do detect
> corruptions between the BT controller and the kernel.
> 
> The dynamic debug messages may help identify whether there are
> missing/truncated USB packets (there is a debug message in
> btusb_intr_complete() from drivers/bluetooth/btusb.c to help identify
> HCI reassembly issues).
> 
> Did you try using only the BT dongle and removing the Wifi one (and
> connecting through ethernet cable)? Wifi dongles tend to be very power
> hungry.
> 
> Also check whether the power source for the USB hub is working
> properly... unfortunately I don't know how to check from the RPi side,
> so you have to rely on first attaching it to the outlet, checking some
> LED, and then attaching to the RPi. Also make sure the RPi uses its
> own power adapter (instead of powering from the hub itself).
> 
> Well, at least you found a workaround (attaching an ethernet cable) :)
> 
> Best Regards,
> -- 
> Anderson Lizardo
> http://www.indt.org/?lang=en
> INdT - Manaus - Brazil
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Adam Warski

http://twitter.com/#!/adamwarski
http://www.softwaremill.com
http://www.warski.org


^ permalink raw reply

* [PATCH] input: Control HID encryption from input.conf
From: Petri Gynther @ 2014-03-05 22:15 UTC (permalink / raw)
  To: linux-bluetooth

Add support for optional config item "Encryption=<true|false>" in input.conf.
Allows HID encryption to be disabled for keyboards and keyboard-like devices
that don't work properly with encryption due to firmware bugs.
---
 profiles/input/device.c  |  8 +++++++-
 profiles/input/device.h  |  1 +
 profiles/input/manager.c | 21 ++++++++++++++++-----
 3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/profiles/input/device.c b/profiles/input/device.c
index d6e97c7..e2f97dc 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
@@ -85,12 +85,18 @@ struct input_device {
 };
 
 static int idle_timeout = 0;
+static gboolean encryption_enabled = TRUE;
 
 void input_set_idle_timeout(int timeout)
 {
 	idle_timeout = timeout;
 }
 
+void input_enable_encryption(gboolean state)
+{
+	encryption_enabled = state;
+}
+
 static void input_device_enter_reconnect_mode(struct input_device *idev);
 
 static void input_device_free(struct input_device *idev)
@@ -424,7 +430,7 @@ static int hidp_add_connection(struct input_device *idev)
 		strncpy(req->name, idev->name, sizeof(req->name) - 1);
 
 	/* Encryption is mandatory for keyboards */
-	if (req->subclass & 0x40) {
+	if (encryption_enabled && (req->subclass & 0x40)) {
 		if (!bt_io_set(idev->intr_io, &gerr,
 					BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
 					BT_IO_OPT_INVALID)) {
diff --git a/profiles/input/device.h b/profiles/input/device.h
index da2149c..af9f5ea 100644
--- a/profiles/input/device.h
+++ b/profiles/input/device.h
@@ -28,6 +28,7 @@ struct input_device;
 struct input_conn;
 
 void input_set_idle_timeout(int timeout);
+void input_enable_encryption(gboolean state);
 
 int input_device_register(struct btd_service *service);
 void input_device_unregister(struct btd_service *service);
diff --git a/profiles/input/manager.c b/profiles/input/manager.c
index 6ef83f4..1a70391 100644
--- a/profiles/input/manager.c
+++ b/profiles/input/manager.c
@@ -97,15 +97,26 @@ static int input_init(void)
 	config = load_config_file(CONFIGDIR "/input.conf");
 	if (config) {
 		int idle_timeout;
+		gboolean encryption;
 
 		idle_timeout = g_key_file_get_integer(config, "General",
-						"IdleTimeout", &err);
-		if (err) {
-			DBG("input.conf: %s", err->message);
-			g_error_free(err);
+							"IdleTimeout", &err);
+		if (!err) {
+			DBG("input.conf: IdleTimeout=%d", idle_timeout);
+			input_set_idle_timeout(idle_timeout * 60);
+		} else {
+			g_clear_error(&err);
 		}
 
-		input_set_idle_timeout(idle_timeout * 60);
+		encryption = g_key_file_get_boolean(config, "General",
+							"Encryption", &err);
+		if (!err) {
+			DBG("input.conf: Encryption=%s", encryption ?
+							"true" : "false");
+			input_enable_encryption(encryption);
+		} else {
+			g_clear_error(&err);
+		}
 	}
 
 	btd_profile_register(&input_profile);
-- 
1.9.0.279.gdc9e3eb


^ permalink raw reply related

* Re: [PATCH] input: Control HID encryption from input.conf
From: Marcel Holtmann @ 2014-03-05 23:09 UTC (permalink / raw)
  To: Petri Gynther; +Cc: linux-bluetooth
In-Reply-To: <20140305221503.CBDCE100321@puck.mtv.corp.google.com>

Hi Petri,

> Add support for optional config item "Encryption=<true|false>" in input.conf.
> Allows HID encryption to be disabled for keyboards and keyboard-like devices
> that don't work properly with encryption due to firmware bugs.

really? I assumed the specification and qualification is pretty clear. Encryption is a must requirement for keyboard devices. Do you have traces where this causes issues.

I would also like to hear about samples of these broken keyboards. I have to admit that I have not personally used a Bluetooth keyboard in a while, but when developing the HID support back in the days, the encryption was never an issue. So I am surprised to hear that it has gotten worse and I hope this is not a bug on our side.

Regards

Marcel


^ permalink raw reply

* [PATCH] android/pics: Add PICS and PIXIT for GATT
From: Sebastian Chlad @ 2014-03-06  6:27 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sebastian Chlad

Adding PICS and PIXIT for GATT targetting Android 4.4
---
 android/Makefile.am    |   2 +
 android/pics-gatt.txt  | 322 +++++++++++++++++++++++++++++++++++++++++++++++++
 android/pixit-gatt.txt |  31 +++++
 3 files changed, 355 insertions(+)
 create mode 100644 android/pics-gatt.txt
 create mode 100644 android/pixit-gatt.txt

diff --git a/android/Makefile.am b/android/Makefile.am
index 31f905c..ca91eee 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -191,6 +191,7 @@ EXTRA_DIST += android/Android.mk android/README \
 				android/pics-avrcp.txt \
 				android/pics-hsp.txt \
 				android/pics-hfp.txt \
+				android/pics-gatt.txt \
 				android/pixit-l2cap.txt \
 				android/pixit-gap.txt \
 				android/pixit-did.txt \
@@ -204,6 +205,7 @@ EXTRA_DIST += android/Android.mk android/README \
 				android/pixit-avrcp.txt \
 				android/pixit-hsp.txt \
 				android/pixit-hfp.txt \
+				android/pixit-gatt.txt \
 				android/pts-l2cap.txt \
 				android/pts-gap.txt \
 				android/pts-did.txt \
diff --git a/android/pics-gatt.txt b/android/pics-gatt.txt
new file mode 100644
index 0000000..8abf8c2
--- /dev/null
+++ b/android/pics-gatt.txt
@@ -0,0 +1,322 @@
+GATT PICS for the PTS tool.
+
+PTS version: 5.0
+
+* - different than PTS defaults
+
+M - mandatory
+O - optional
+
+		Generic Attribute Profile Role
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_GATT_1_1	True		Generic Attribute Profile Client (C.1)
+TSPC_GATT_1_2	True		Generic Attribute Profile Server (C.2)
+TSPC_GATT_1A_1	False (*)	Complete GATT client (C.3)
+TSPC_GATT_1A_2	False (*)	Complete GATT server (C.4)
+-------------------------------------------------------------------------------
+C.1: Optional to support IF TSPC_GATT_2_2; else IF TSPC_GATT_2_1 it is mandatory
+	to support at least one of TSPC_GATT_1_1 OR TSPC_GATT_1_2
+C.2: Mandatory to support IF TSPC_GATT_2_2; else IF TSPC_GATT_2_1 it is
+	mandatory to support at least one of TSPC_GATT_1_1 OR TSPC_GATT_1_2
+C.3: Optional IF TSPC_GATT_1_1 is supported, otherwise Excluded
+C.4: Optional IF TSPC_GATT_1_2 is supported, otherwise Excluded
+-------------------------------------------------------------------------------
+
+
+		ATT Bearer Transport
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_GATT_2_1	True		Attribute Protocol Supported over BR/EDR
+					(L2CAP fixed channel support) (C.1)
+TSPC_GATT_2_2	True		Attribute Protocol Supported over LE (C.2)
+-------------------------------------------------------------------------------
+C.1: Mandatory IF (SUM ICS 12/2 OR SUM ICS 12/9) is supported, otherwise
+	Excluded
+C.2: Mandatory IF (SUM ICS 12/7 OR SUM ICS 12/9) is supported, otherwise
+	Excluded
+-------------------------------------------------------------------------------
+
+
+
+		Generic Attribute Profile Support
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_GATT_3_1	True		Client: Exchange MTU (C.1)
+TSPC_GATT_3_2	True		Client: Discover All Primary Services (C.1)
+TSPC_GATT_3_3	True		Client: Discover Primary Services Service
+					UUID (C.1)
+TSPC_GATT_3_4	True		Client: Find Included Services (C.1)
+TSPC_GATT_3_5	True		Client: Discover All characteristics of a
+					Service (C.1)
+TSPC_GATT_3_6	True		Client: Discover Characteristics by UUID (C.1)
+TSPC_GATT_3_7	True		Client: Discover All Characteristic Descriptors
+					(C.1)
+TSPC_GATT_3_8	True		Client: Read Characteristic Value (C.1)
+TSPC_GATT_3_9	True		Client: Read using Characteristic UUID (C.1)
+TSPC_GATT_3_10	True		Client: Read Long Characteristic Values (C.1)
+TSPC_GATT_3_11	True		Client: Read Multiple Characteristic
+					Values (C.1)
+TSPC_GATT_3_12	True		Client: Write without Response (C.1)
+TSPC_GATT_3_13	True		Client: Signed Write Without Response (C.1)
+TSPC_GATT_3_14	True		Client: Write Characteristic Value (C.1)
+TSPC_GATT_3_15	True		Client: Write Long Characteristic Values (C.1)
+TSPC_GATT_3_16	True		Client: Characteristic Value Reliable
+					Writes (C.1)
+TSPC_GATT_3_17	True		Client: Notifications (C.1)
+TSPC_GATT_3_18	True		Client: Indications (M)
+TSPC_GATT_3_19	True		Client: Read Characteristic Descriptors (C.1)
+TSPC_GATT_3_20	True		Client: Read long Characteristic Descriptors
+					(C.1)
+TSPC_GATT_3_21	True		Client: Write Characteristic Descriptors (C.1)
+TSPC_GATT_3_22	True		Client: Write Long Characteristic Descriptors
+					(C.1)
+TSPC_GATT_3_23	True		Client: Service Changed Characteristic (M)
+TSPC_GATT_3B_1	True		Client: Primary Service Declaration (M)
+TSPC_GATT_3B_2	True		Client: Secondary Service Declaration (M)
+TSPC_GATT_3B_3	True		Client: Include Declaration (M)
+TSPC_GATT_3B_4	True		Client: Characteristic Declaration (M)
+TSPC_GATT_3B_5	True		Client: Characteristic Value Declaration (M)
+TSPC_GATT_3B_6	True		Client: Characteristic Extended Properties (M)
+TSPC_GATT_3B_7	True		Client: Characteristic User Description
+					Descriptor (M)
+TSPC_GATT_3B_8	True		Client: Client Characteristic Configuration
+					Descriptor (M)
+TSPC_GATT_3B_9	True		Client: Server Characteristic Configuration
+					Descriptor (M)
+TSPC_GATT_3B_10	True		Client: Characteristic Format Descriptor (M)
+TSPC_GATT_3B_11	True		Client: Characteristic Aggregate Format
+					Descriptor (M)
+TSPC_GATT_3B_12	True		Client: Characteristic Format: Boolean (M)
+TSPC_GATT_3B_13	True		Client: Characteristic Format: 2Bit (M)
+TSPC_GATT_3B_14	True		Client: Characteristic Format: nibble (M)
+TSPC_GATT_3B_15	True		Client: Characteristic Format: Uint8 (M)
+TSPC_GATT_3B_16	True		Client: Characteristic Format: Uint12 (M)
+TSPC_GATT_3B_17	True		Client: Characteristic Format: Uint16 (M)
+TSPC_GATT_3B_18	True		Client: Characteristic Format: Uint24 (M)
+TSPC_GATT_3B_19	True		Client: Characteristic Format: Uint32 (M)
+TSPC_GATT_3B_20	True		Client: Characteristic Format: Uint48 (M)
+TSPC_GATT_3B_21	True		Client: Characteristic Format: Uint64 (M)
+TSPC_GATT_3B_22	True		Client: Characteristic Format: Uint128 (M)
+TSPC_GATT_3B_23	True		Client: Characteristic Format: Sint8 (M)
+TSPC_GATT_3B_24	True		Client: Characteristic Format: Sint12 (M)
+TSPC_GATT_3B_25	True		Client: Characteristic Format: Sint16 (M)
+TSPC_GATT_3B_26	True		Client: Characteristic Format: Sint24 (M)
+TSPC_GATT_3B_27	True		Client: Characteristic Format: Sint32 (M)
+TSPC_GATT_3B_28	True		Client: Characteristic Format: Sint48 (M)
+TSPC_GATT_3B_29	True		Client: Characteristic Format: Sint64 (M)
+TSPC_GATT_3B_30	True		Client: Characteristic Format: Sint128 (M)
+TSPC_GATT_3B_31	True		Client: Characteristic Format: Float32 (M)
+TSPC_GATT_3B_32	True		Client: Characteristic Format: Float64 (M)
+TSPC_GATT_3B_33	True		Client: Characteristic Format: SFLOAT (M)
+TSPC_GATT_3B_34	True		Client: Characteristic Format: FLOAT (M)
+TSPC_GATT_3B_35	True		Client: Characteristic Format: Duint16 (M)
+TSPC_GATT_3B_36	True		Client: Characteristic Format: utf8s (M)
+TSPC_GATT_3B_37	True		Client: Characteristic Format: utf16s (M)
+TSPC_GATT_3B_38	True		Client: Characteristic Format: struct (M)
+-------------------------------------------------------------------------------
+C.1: Mandatory IF TSPC_GATT_1A_1 is supported, otherwise Optional
+-------------------------------------------------------------------------------
+
+
+
+		Generic Attribute Profile Support, by Server
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_GATT_4_1	True		Server: Exchange MTU (C.4)
+TSPC_GATT_4_2	True		Server: Discover All Primary Services (M)
+TSPC_GATT_4_3	True		Server: Discover Primary Services Service
+					UUID (M)
+TSPC_GATT_4_4	True		Server: Find Included Services (M)
+TSPC_GATT_4_5	True		Server: Discover All characteristics of
+					a Service (M)
+TSPC_GATT_4_6	True		Server: Discover Characteristics by UUID (M)
+TSPC_GATT_4_7	True		Server: Discover All Characteristic
+					Descriptors (M)
+TSPC_GATT_4_8	True		Server: Read Characteristic Value (M)
+TSPC_GATT_4_9	True		Server: Read using Characteristic UUID (M)
+TSPC_GATT_4_10	True		Server: Read Long Characteristic Values (C.4)
+TSPC_GATT_4_11	True		Server: Read Multiple Characteristic
+					Values (C.4)
+TSPC_GATT_4_12	True		Server: Write without Response (C.2)
+TSPC_GATT_4_13	False (*)	Server: Signed Write Without Response (C.4)
+TSPC_GATT_4_14	True		Server: Write Characteristic Value (C.3)
+TSPC_GATT_4_15	True		Server: Write Long Characteristic Values (C.4)
+TSPC_GATT_4_16	True		Server: Characteristic Value Reliable
+					Writes (C.4)
+TSPC_GATT_4_17	True		Server: Notifications (C.4)
+TSPC_GATT_4_18	True		Server: Indications (C.1)
+TSPC_GATT_4_19	True		Server: Read Characteristic Descriptors (C.4)
+TSPC_GATT_4_20	True		Server: Read long Characteristic
+					Descriptors (C.4)
+TSPC_GATT_4_21	True		Server: Write Characteristic Descriptors (C.4)
+TSPC_GATT_4_22	True		Server: Write Long Characteristic
+					Descriptors (C.4)
+TSPC_GATT_4_23	True		Server: Service Changed Characteristic (C.1)
+-------------------------------------------------------------------------------
+C.1: Mandatory IF service definitions on the server can be added, changed, or
+	removed, otherwise Optional
+C.2: Mandatory IF GATT TSPC_GATT_4_13 is supported, otherwise Optional
+C.3: Mandatory IF GATT TSPC_GATT_4_15 is supported, otherwise Optional
+C.4: Mandatory IF GATT TSPC_GATT_1A_2 is supported, otherwise Optional
+-------------------------------------------------------------------------------
+
+
+		Profile Attribute Types and Characteristic Formats
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_GATT_4B_1	True		Server: Primary Service Declaration (M)
+TSPC_GATT_4B_2	True		Server: Secondary Service Declaration (M)
+TSPC_GATT_4B_3	True		Server: Include Declaration (M)
+TSPC_GATT_4B_4	True		Server: Characteristic Declaration (M)
+TSPC_GATT_4B_5	True		Server: Characteristic Value Declaration (M)
+TSPC_GATT_4B_6	True		Server: Characteristic Extended Properties (M)
+TSPC_GATT_4B_7	True		Server: Characteristic User Description
+					Descriptor (M)
+TSPC_GATT_4B_8	True		Server: Client Characteristic Configuration
+					Descriptor (M)
+TSPC_GATT_4B_9	True		Server: Server Characteristic Configuration
+					Descriptor (M)
+TSPC_GATT_4B_10	True		Server: Characteristic Format Descriptor (M)
+TSPC_GATT_4B_11	True		Server: Characteristic Aggregate Format
+					Descriptor (M)
+TSPC_GATT_4B_12	True		Server: Characteristic Format: Boolean (M)
+TSPC_GATT_4B_13	True		Server: Characteristic Format: 2Bit (M)
+TSPC_GATT_4B_14	True		Server: Characteristic Format: nibble (M)
+TSPC_GATT_4B_15	True		Server: Characteristic Format: Uint8 (M)
+TSPC_GATT_4B_16	True		Server: Characteristic Format: Uint12 (M)
+TSPC_GATT_4B_17	True		Server: Characteristic Format: Uint16 (M)
+TSPC_GATT_4B_18	True		Server: Characteristic Format: Uint24 (M)
+TSPC_GATT_4B_19	True		Server: Characteristic Format: Uint32 (M)
+TSPC_GATT_4B_20	True		Server: Characteristic Format: Uint48 (M)
+TSPC_GATT_4B_21	True		Server: Characteristic Format: Uint64 (M)
+TSPC_GATT_4B_22	True		Server: Characteristic Format: Uint128 (M)
+TSPC_GATT_4B_23	True		Server: Characteristic Format: Sint8 (M)
+TSPC_GATT_4B_24	True		Server: Characteristic Format: Sint12 (M)
+TSPC_GATT_4B_25	True		Server: Characteristic Format: Sint16 (M)
+TSPC_GATT_4B_26	True		Server: Characteristic Format: Sint24 (M)
+TSPC_GATT_4B_27	True		Server: Characteristic Format: Sint32 (M)
+TSPC_GATT_4B_28	True		Server: Characteristic Format: Sint48 (M)
+TSPC_GATT_4B_29	True		Server: Characteristic Format: Sint64 (M)
+TSPC_GATT_4B_30	True		Server: Characteristic Format: Sint128 (M)
+TSPC_GATT_4B_31	True		Server: Characteristic Format: Float32 (M)
+TSPC_GATT_4B_32	True		Server: Characteristic Format: Float64 (M)
+TSPC_GATT_4B_33	True		Server: Characteristic Format: SFLOAT (M)
+TSPC_GATT_4B_34	True		Server: Characteristic Format: FLOAT (M)
+TSPC_GATT_4B_35	True		Server: Characteristic Format: Duint16 (M)
+TSPC_GATT_4B_36	True		Server: Characteristic Format: utf8s (M)
+TSPC_GATT_4B_37	True		Server: Characteristic Format: utf16s (M)
+TSPC_GATT_4B_38	True		Server: Characteristic Format: struct (M)
+-------------------------------------------------------------------------------
+
+
+		Generic Attribute Profile Service
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_GATT_6_2	True		Discover GATT Services using Service Discovery
+					Profile (C.1)
+TSPC_GATT_6_3	True		Publish SDP record for GATT services support
+					via BR/EDR (C.2)
+-------------------------------------------------------------------------------
+C.1: Mandatory IF TSPC_GATT_1_1 is supported, otherwise Excluded
+C.2: Mandatory IF TSPC_GATT_1_2 is supported, otherwise Excluded
+-------------------------------------------------------------------------------
+
+
+		Attribute Protocol Transport Security
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_GATT_7_1	True		Security Mode 4 (C.1)
+TSPC_GATT_7_2	True		LE Security Mode 1 (C.2)
+TSPC_GATT_7_3	True		LE Security Mode 2 (C.2)
+TSPC_GATT_7_4	True		LE Authentication Procedure (C.2)
+TSPC_GATT_7_5	True		LE connection data signing procedure (C.2)
+TSPC_GATT_7_6	True		LE Authenticate signed data procedure (C.2)
+TSPC_GATT_7_7	False (*)	LE Authorization Procedure (C.2)
+-------------------------------------------------------------------------------
+C.1: Mandatory IF TSPC_GATT_2_1 is supported, otherwise Excluded
+C.2: Optional IF TSPC_GATT_2_2 is supported, otherwise Excluded
+-------------------------------------------------------------------------------
+
+
+		Attribute Protocol Client Messages
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_ATT_3_1	True		Attribute Error Response (M)
+TSPC_ATT_3_2	False (*)	Exchange MTU Request (O)
+TSPC_ATT_3_4	False (*)	Find Information Request (O)
+TSPC_ATT_3_6	False (*)	Find by Type Value Request (O)
+TSPC_ATT_3_8	False (*)	Read by Type Request (O)
+TSPC_ATT_3_10	False (*)	Read Request (O)
+TSPC_ATT_3_12	False (*)	Read Blob Request (O)
+TSPC_ATT_3_14	False (*)	Read Multiple Request (O)
+TSPC_ATT_3_16	False (*)	Read by Group Type Request (O)
+TSPC_ATT_3_17	False (*)	Read by Group Type Response (C.6)
+TSPC_ATT_3_18	False (*)	Write Request (O)
+TSPC_ATT_3_20	False (*)	Write Command (O)
+TSPC_ATT_3_21	False (*)	Signed Write Command (O)
+TSPC_ATT_3_22	False (*)	Prepare Write Request (O)
+TSPC_ATT_3_24	False (*)	Execute Write Request (C.8)
+TSPC_ATT_3_26	True		Handle Value Notification (M)
+-------------------------------------------------------------------------------
+C.6: Mandatory IF TSPC_ATT_3_16 is supported, otherwise Excluded
+C.8: Mandatory IF TSPC_ATT_3_22 is supported, otherwise Excluded
+-------------------------------------------------------------------------------
+
+		Attribute Protocol Server Messages
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_ATT_4_1	True		Attribute Error Response (M)
+TSPC_ATT_4_3	True		Exchange MTU Response (M)
+TSPC_ATT_4_5	True		Find Information Response (M)
+TSPC_ATT_4_7	True		Find by Type Value Response (M)
+TSPC_ATT_4_8	True		Read by Type Request (M)
+TSPC_ATT_4_9	True		Read by Type Response (M)
+TSPC_ATT_4_11	True		Read Response (M)
+TSPC_ATT_4_15	False (*)	Read Multiple Response (C.2)
+TSPC_ATT_4_17	True		Read by Group Type Response (M)
+TSPC_ATT_4_19	False (*)	Write Response (C.3)
+TSPC_ATT_4_20	False (*)	Write Command (O)
+TSPC_ATT_4_21	False (*)	Signed Write Command (O)
+TSPC_ATT_4_23	False (*)	Prepare Write Response (C.4)
+TSPC_ATT_4_25	False (*)	Execute Write Response (C.5)
+TSPC_ATT_4_26	False (*)	Handle Value Notification (O)
+-------------------------------------------------------------------------------
+C.2: Mandatory IF TSPC_ATT_4_14 is supported, otherwise Excluded
+C.3: Mandatory IF TSPC_ATT_4_18 is supported, otherwise Excluded
+C.4: Mandatory IF TSPC_ATT_4_22 is supported, otherwise Excluded
+C.5: Mandatory IF TSPC_ATT_4_27 is supported, otherwise Excluded
+-------------------------------------------------------------------------------
+
+
+		Attribute Protocol Transport
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_ATT_5_2	False (*)	LE Security Mode 1 (C.2)
+TSPC_ATT_5_4	False (*)	LE Authentication Procedure (C.2)
+TSPC_ATT_5_7	False (*)	LE Authorization Procedure (C.2)
+-------------------------------------------------------------------------------
+C.2: Optional to support if 2/2 (Attribute Protocol Supported over LE),
+	otherwise Excluded
+-------------------------------------------------------------------------------
+
+
+		Device Configuration
+-------------------------------------------------------------------------------
+Parameter Name	Selected	Description
+-------------------------------------------------------------------------------
+TSPC_GAP_0_2	False (*)	LE (C.2)
+-------------------------------------------------------------------------------
+C.2: Mandatory IF (SUM ICS 34/2 (LE GAP) AND NOT SUM ICS 32/3 (BR/EDR GAP))
+	is supported, otherwise Excluded
+-------------------------------------------------------------------------------
diff --git a/android/pixit-gatt.txt b/android/pixit-gatt.txt
new file mode 100644
index 0000000..7bb8a28
--- /dev/null
+++ b/android/pixit-gatt.txt
@@ -0,0 +1,31 @@
+GATT PIXIT for the PTS tool.
+
+PTS version: 5.0
+
+* - different than PTS defaults
+& - should be set to IUT Bluetooth address
+
+		Required PIXIT settings
+-------------------------------------------------------------------------------
+Parameter Name						Value
+-------------------------------------------------------------------------------
+TSPX_bd_addr_iut					112233445566 (*&)
+TSPX_security_enabled					FALSE
+TSPX_delete_link_key					TRUE
+TSPX_time_guard						180000
+TSPX_selected_handle					0012
+TSPX_use_implicit_send					TRUE
+TSPX_secure_simple_pairing_pass_key_confirmation	FALSE
+TSPX_iut_use_dynamic_bd_addr				FALSE
+TSPX_iut_setup_att_over_br_edr				FALSE
+TSPX_tester_database_file				[Path to GATT Test
+								Database]
+TSPX_iut_is_client_periphral				FALSE
+TSPX_iut_is_server_central				FALSE
+TSPX_mtu_size						23
+TSPX_pin_code						0000
+TSPX_use_dynamic_pin					FALSE
+TSPX_delete_ltk						FALSE
+TSPX_characteristic_readable
+TSPX_tester_appearance					0000
+-------------------------------------------------------------------------------
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH] android/pts: PAN PICS and PTS results
From: Sebastian Chlad @ 2014-03-06  7:07 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sebastian Chlad

Adjusting some optional PICS settings as well as updating PTS
test's results
---
 android/pics-pan.txt | 42 +++++++++++++++++++++---------------------
 android/pts-pan.txt  | 36 ++++++++++++++++++++++++------------
 2 files changed, 45 insertions(+), 33 deletions(-)

diff --git a/android/pics-pan.txt b/android/pics-pan.txt
index 16457bf..0caa629 100644
--- a/android/pics-pan.txt
+++ b/android/pics-pan.txt
@@ -12,14 +12,14 @@ O - optional
 -------------------------------------------------------------------------------
 Parameter Name	Selected	Description
 -------------------------------------------------------------------------------
-TSPC_PAN_1_1	True (*#)	Role: Network Access Point (O.1)
+TSPC_PAN_1_1	True (*)	Role: Network Access Point (O.1)
 TSPC_PAN_1_2	False		Role: Group Ad-hoc Network (O.1)
-TSPC_PAN_1_3	True (*#)	Role: PAN User (O.1)
-TSPC_PAN_1a_1	True (#)	BNEP: BNEP Connection Setup (M)
-TSPC_PAN_1a_2	True (#)	BNEP: BNEP Data Packet Reception (M)
-TSPC_PAN_1a_3	True (#)	BNEP: BNEP Data Packet Transmission (M)
-TSPC_PAN_1a_4	True (#)	BNEP: BNEP Control Message Processing (M)
-TSPC_PAN_1a_5	True (#)	BNEP: BNEP Extension Header Processing (M)
+TSPC_PAN_1_3	True (*)	Role: PAN User (O.1)
+TSPC_PAN_1a_1	True		BNEP: BNEP Connection Setup (M)
+TSPC_PAN_1a_2	True		BNEP: BNEP Data Packet Reception (M)
+TSPC_PAN_1a_3	True		BNEP: BNEP Data Packet Transmission (M)
+TSPC_PAN_1a_4	True		BNEP: BNEP Control Message Processing (M)
+TSPC_PAN_1a_5	True		BNEP: BNEP Extension Header Processing (M)
 TSPC_PAN_1a_6	False		BNEP: Network Protocol Filter Message
 					Transmission (O)
 TSPC_PAN_1a_7	False		BNEP: Multicast Address Filter Message
@@ -33,21 +33,21 @@ O.1: It is mandatory to support at least one of the defined roles.
 -------------------------------------------------------------------------------
 Parameter Name	Selected	Description
 -------------------------------------------------------------------------------
-TSPC_PAN_2_1	True (#)	NAP: Support BNEP (M)
-TSPC_PAN_2_2	True (#)	NAP: Support BNEP Forwarding (M)
+TSPC_PAN_2_1	True		NAP: Support BNEP (M)
+TSPC_PAN_2_2	True		NAP: Support BNEP Forwarding (M)
 TSPC_PAN_2_3	False		NAP: Support Layer 2-Bridging between PAN and
 					External Network (C.1)
-TSPC_PAN_2_4	True (*#)	NAP: Support IP forwarding between PAN and
+TSPC_PAN_2_4	True (*)	NAP: Support IP forwarding between PAN and
 					External Network (C.1)
 TSPC_PAN_2_5	False		NAP: Support BNEP Packet Filtering (O)
-TSPC_PAN_2_6	True (*#)	NAP: Support IPv4 (C.2)
-TSPC_PAN_2_6a	True (*#)	NAP: Supports operable routable IPv4 address (O)
+TSPC_PAN_2_6	False		NAP: Support IPv4 (C.2)
+TSPC_PAN_2_6a	False		NAP: Supports operable routable IPv4 address (O)
 TSPC_PAN_2_6b	False		NAP: Support link-local address configuration
 					for IPv4 (C.4)
 TSPC_PAN_2_7	False		NAP: Support ping client for IPv4 (O)
 TSPC_PAN_2_8	False		NAP: Support DHCP Client for IPv4 (O)
 TSPC_PAN_2_9	False		NAP: Support DNS/LLMNR Resolver for IPv4 (O)
-TSPC_PAN_2_9a	True (#)	NAP: Support LLMNR Sender for IPv4 (C.5)
+TSPC_PAN_2_9a	False		NAP: Support LLMNR Sender for IPv4 (C.5)
 TSPC_PAN_2_9b	False		NAP: Support LLMNR Responder for IPv4 (O)
 TSPC_PAN_2_10	False		NAP: Support HTTP Client for IPv4 (O)
 TSPC_PAN_2_11	False		NAP: Support WAP Client for IPv4 (O)
@@ -58,8 +58,8 @@ TSPC_PAN_2_14a	False (*)	NAP: Support LLMNR Sender for IPv6 (C.6)
 TSPC_PAN_2_14b	False		NAP: Support LLMNR Responder for IPv6 (O)
 TSPC_PAN_2_15	False		NAP: Support HTTP Client for IPv6 (O)
 TSPC_PAN_2_16	False		NAP: Support WAP Client for IPv6 (O)
-TSPC_PAN_2_17	True (#)	NAP: Supports Connectable Mode (M)
-TSPC_PAN_2_18	True (#)	NAP: NAP Service Record (M)
+TSPC_PAN_2_17	True		NAP: Supports Connectable Mode (M)
+TSPC_PAN_2_18	True		NAP: NAP Service Record (M)
 TSPC_PAN_2_19	False		NAP: Support at least three PANUs (O)
 TSPC_PAN_2_20	False		NAP: Support at least two PANUs (O)
 -------------------------------------------------------------------------------
@@ -73,7 +73,7 @@ C.3: Mandatory to support IF any IPv6-based transport protocol OR
 	(TSPC_PAN_2_13-16) is supported, ELSE Optional.
 C.4: Mandatory if TSPC_PAN_2_6 is supported and TSPC_PAN_2_6a is not supported,
 	otherwise optional.
-C.5: Mandatory if item (TSPC_PAN_2_6) or item supported.
+C.5: Mandatory if item (TSPC_PAN_2_6) supported.
 C.6: Mandatory if item (TSPC_PAN_2_12) supported
 -------------------------------------------------------------------------------
 
@@ -119,12 +119,12 @@ C.4: Mandatory to support if (TSPC_PAN_3_10) is supported.
 -------------------------------------------------------------------------------
 Parameter Name	Selected	Description
 -------------------------------------------------------------------------------
-TSPC_PAN_4_1	True (#)	PANU: Support BNEP (M)
-TSPC_PAN_4_2	True (*#)	PANU: Support IPv4 (C.1)
-TSPC_PAN_4_3	True (*#)	PANU: Support ping client for IPv4 (O)
-TSPC_PAN_4_4	True (*#)	PANU: Support DHCP client for  IPv4 (O)
+TSPC_PAN_4_1	True		PANU: Support BNEP (M)
+TSPC_PAN_4_2	True		PANU: Support IPv4 (C.1)
+TSPC_PAN_4_3	False		PANU: Support ping client for IPv4 (O)
+TSPC_PAN_4_4	False		PANU: Support DHCP client for  IPv4 (O)
 TSPC_PAN_4_5	False		PANU: Support DNS/LLMNR Resolver for IPv4 (O)
-TSPC_PAN_4_5a	True (#)	PANU: Support LLMNR Sender for IPv4 (C.2)
+TSPC_PAN_4_5a	True		PANU: Support LLMNR Sender for IPv4 (C.2)
 TSPC_PAN_4_5b	False		PANU: Support LLMNR Responder for IPv4 (O)
 TSPC_PAN_4_6	False		PANU: Support HTTP Client for IPv4 (O)
 TSPC_PAN_4_7	False		PANU: Support WAP Client for IPv4 (O)
diff --git a/android/pts-pan.txt b/android/pts-pan.txt
index 8e8ae41..74c482a 100644
--- a/android/pts-pan.txt
+++ b/android/pts-pan.txt
@@ -10,9 +10,9 @@ FAIL	test failed
 INC	test is inconclusive
 N/A	test is disabled due to PICS setup
 
--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
 Test Name				Result	Notes
--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
 TC_BNEP_GN_BROADCAST_0_BV_03_C		N/A
 TC_GN_Ipv4_Autonet_BV_01_I		N/A
 TC_GN_Ipv6_Autonet_BV_02_I		N/A
@@ -34,37 +34,49 @@ TC_BNEP_NAP_FORWARD_UNICAST_BV_05_C	N/A
 TC_BNEP_NAP_FORWARD_UNICAST_BV_06_C	N/A
 TC_BNEP_NAP_MULTICAST_0_BV_03_C		N/A
 TC_BNEP_NAP_MULTICAST_0_BV_04_C		N/A
-TC_BNEP_BRIDGE_RX_BV_02_I		INC
+TC_BNEP_BRIDGE_RX_BV_02_I		PASS	Tester needs to send one
+						forward-unicast	BNEP packet
+						with given data (5 times)
+						0x00, 0x01, 0xFF followed by
+						0x00, 0x01, 0x9E, 0x9F
+						sendip -d <hexdata>
 TC_BNEP_BRIDGE_TX_BV_01_I		PASS
 TC_NAP_Ipv4_Autonet_BV_01_I		N/A
 TC_NAP_Ipv6_Autonet_BV_02_I		N/A
 TC_NAP_IP_DHCP_BV_03_I			N/A
-TC_NAP_IP_LLMNR_BV_01_I			INC
+TC_NAP_IP_LLMNR_BV_01_I			N/A
 TC_NAP_IP_LLMNR_BV_02_I			N/A
 TC_NAP_IP_DNS_BV_01_I			N/A
 TC_NAP_IP_APP_BV_01_I			N/A
 TC_NAP_IP_APP_BV_02_I			N/A
 TC_NAP_IP_APP_BV_03_I			N/A
 TC_NAP_IP_APP_BV_04_I			N/A
-TC_NAP_IP_APP_BV_05_I			PASS
+TC_NAP_IP_APP_BV_05_I			N/A
 TC_SDP_NAP_BV_01_C			PASS
 TC_MISC_NAP_UUID_BV_01_C		PASS
 TC_MISC_NAP_UUID_BV_02_C		PASS
 TC_BNEP_PANU_BROADCAST_0_BV_04_C	N/A
-TC_PANU_Ipv4_Autonet_BV_01_I		INC
+TC_PANU_Ipv4_Autonet_BV_01_I		PASS	When prompted connect to PTS.
+						From IUT: issue ARP request
+						iperf -c <addr> -p <port#>
 TC_PANU_Ipv6_Autonet_BV_02_I		N/A
-TC_PANU_IP_LLMNR_BV_01_I		INC
+TC_PANU_IP_LLMNR_BV_01_I		PASS	When prompted connect to PTS.
+						From IUT: send LLMNR request
+						command
+						iperf -c <addr> -p <port#>
 TC_PANU_IP_LLMNR_BV_02_I		N/A
-TC_PANU_IP_DHCP_BV_03_I			PASS
+TC_PANU_IP_DHCP_BV_03_I			N/A
 TC_PANU_IP_DNS_BV_01_I			N/A
 TC_PANU_IP_APP_BV_01_I			N/A
 TC_PANU_IP_APP_BV_02_I			N/A
-TC_PANU_IP_APP_BV_03_I			INC
-TC_PANU_IP_APP_BV_04_I			INC
-TC_PANU_IP_APP_BV_05_I			PASS
+TC_PANU_IP_APP_BV_03_I			N/A
+TC_PANU_IP_APP_BV_04_I			N/A
+TC_PANU_IP_APP_BV_05_I			PASS	When prompted, connect to PTS
+						and then when prompted terminate
+						connection (IUT side)
 TC_SDP_PANU_BV_01_C			N/A
 TC_MISC_PANU_UUID_BV_01_C		N/A
 TC_MISC_PANU_UUID_BV_02_C		N/A
 TC_MISC_ROLE_BV_01_C			N/A
 TC_MISC_ROLE_BV_BV_02_C			N/A
--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH] android/pics: change AVRCP to 1.5
From: Sebastian Chlad @ 2014-03-06  8:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sebastian Chlad

Simple PICS switch from AVRCP 1.3 to 1.5
---
 android/pics-avrcp.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/pics-avrcp.txt b/android/pics-avrcp.txt
index 2be0746..69328de 100644
--- a/android/pics-avrcp.txt
+++ b/android/pics-avrcp.txt
@@ -448,9 +448,9 @@ C.15: Mandatory if Basic Group Navigation Feature supported. If any item
 Parameter Name    Selected	Description
 -------------------------------------------------------------------------------
 TSPC_AVRCP_7b_1   False		TG: AVRCP v1.0 (C.1)
-TSPC_AVRCP_7b_2   True (*)	TG: AVRCP v1.3 (C.1)
+TSPC_AVRCP_7b_2   False		TG: AVRCP v1.3 (C.1)
 TSPC_AVRCP_7b_3   False		TG: AVRCP v1.4 (C.1)
-TSPC_AVRCP_7b_4   False		TG: AVRCP v1.5 (C.1)
+TSPC_AVRCP_7b_4   True (*)	TG: AVRCP v1.5 (C.1)
 TSPC_AVRCP_7b_5   False		TG: AVRCP v1.6 (C.1)
 -------------------------------------------------------------------------------
 C.1: It is mandatory to support at least one of the profile versions.
-- 
1.8.5.3


^ permalink raw reply related

* Re: [PATCH] android/pics: Add PICS and PIXIT for GATT
From: Szymon Janc @ 2014-03-06  8:47 UTC (permalink / raw)
  To: Sebastian Chlad; +Cc: linux-bluetooth
In-Reply-To: <1394087259-8909-1-git-send-email-sebastian.chlad@tieto.com>

Hi Sebastian,

On Thursday 06 of March 2014 07:27:39 Sebastian Chlad wrote:
> Adding PICS and PIXIT for GATT targetting Android 4.4
> ---
>  android/Makefile.am    |   2 +
>  android/pics-gatt.txt  | 322 +++++++++++++++++++++++++++++++++++++++++++++++++
>  android/pixit-gatt.txt |  31 +++++
>  3 files changed, 355 insertions(+)
>  create mode 100644 android/pics-gatt.txt
>  create mode 100644 android/pixit-gatt.txt
> 
> diff --git a/android/Makefile.am b/android/Makefile.am
> index 31f905c..ca91eee 100644
> --- a/android/Makefile.am
> +++ b/android/Makefile.am
> @@ -191,6 +191,7 @@ EXTRA_DIST += android/Android.mk android/README \
>  				android/pics-avrcp.txt \
>  				android/pics-hsp.txt \
>  				android/pics-hfp.txt \
> +				android/pics-gatt.txt \
>  				android/pixit-l2cap.txt \
>  				android/pixit-gap.txt \
>  				android/pixit-did.txt \
> @@ -204,6 +205,7 @@ EXTRA_DIST += android/Android.mk android/README \
>  				android/pixit-avrcp.txt \
>  				android/pixit-hsp.txt \
>  				android/pixit-hfp.txt \
> +				android/pixit-gatt.txt \
>  				android/pts-l2cap.txt \
>  				android/pts-gap.txt \
>  				android/pts-did.txt \
> diff --git a/android/pics-gatt.txt b/android/pics-gatt.txt
> new file mode 100644
> index 0000000..8abf8c2
> --- /dev/null
> +++ b/android/pics-gatt.txt
> @@ -0,0 +1,322 @@
> +GATT PICS for the PTS tool.
> +
> +PTS version: 5.0
> +
> +* - different than PTS defaults
> +
> +M - mandatory
> +O - optional
> +
> +		Generic Attribute Profile Role
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_GATT_1_1	True		Generic Attribute Profile Client (C.1)
> +TSPC_GATT_1_2	True		Generic Attribute Profile Server (C.2)
> +TSPC_GATT_1A_1	False (*)	Complete GATT client (C.3)
> +TSPC_GATT_1A_2	False (*)	Complete GATT server (C.4)
> +-------------------------------------------------------------------------------
> +C.1: Optional to support IF TSPC_GATT_2_2; else IF TSPC_GATT_2_1 it is mandatory
> +	to support at least one of TSPC_GATT_1_1 OR TSPC_GATT_1_2
> +C.2: Mandatory to support IF TSPC_GATT_2_2; else IF TSPC_GATT_2_1 it is
> +	mandatory to support at least one of TSPC_GATT_1_1 OR TSPC_GATT_1_2
> +C.3: Optional IF TSPC_GATT_1_1 is supported, otherwise Excluded
> +C.4: Optional IF TSPC_GATT_1_2 is supported, otherwise Excluded
> +-------------------------------------------------------------------------------
> +
> +
> +		ATT Bearer Transport
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_GATT_2_1	True		Attribute Protocol Supported over BR/EDR
> +					(L2CAP fixed channel support) (C.1)
> +TSPC_GATT_2_2	True		Attribute Protocol Supported over LE (C.2)
> +-------------------------------------------------------------------------------
> +C.1: Mandatory IF (SUM ICS 12/2 OR SUM ICS 12/9) is supported, otherwise
> +	Excluded
> +C.2: Mandatory IF (SUM ICS 12/7 OR SUM ICS 12/9) is supported, otherwise
> +	Excluded
> +-------------------------------------------------------------------------------
> +
> +
> +
> +		Generic Attribute Profile Support
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_GATT_3_1	True		Client: Exchange MTU (C.1)
> +TSPC_GATT_3_2	True		Client: Discover All Primary Services (C.1)
> +TSPC_GATT_3_3	True		Client: Discover Primary Services Service
> +					UUID (C.1)
> +TSPC_GATT_3_4	True		Client: Find Included Services (C.1)
> +TSPC_GATT_3_5	True		Client: Discover All characteristics of a
> +					Service (C.1)
> +TSPC_GATT_3_6	True		Client: Discover Characteristics by UUID (C.1)
> +TSPC_GATT_3_7	True		Client: Discover All Characteristic Descriptors
> +					(C.1)
> +TSPC_GATT_3_8	True		Client: Read Characteristic Value (C.1)
> +TSPC_GATT_3_9	True		Client: Read using Characteristic UUID (C.1)
> +TSPC_GATT_3_10	True		Client: Read Long Characteristic Values (C.1)
> +TSPC_GATT_3_11	True		Client: Read Multiple Characteristic
> +					Values (C.1)
> +TSPC_GATT_3_12	True		Client: Write without Response (C.1)
> +TSPC_GATT_3_13	True		Client: Signed Write Without Response (C.1)
> +TSPC_GATT_3_14	True		Client: Write Characteristic Value (C.1)
> +TSPC_GATT_3_15	True		Client: Write Long Characteristic Values (C.1)
> +TSPC_GATT_3_16	True		Client: Characteristic Value Reliable
> +					Writes (C.1)
> +TSPC_GATT_3_17	True		Client: Notifications (C.1)
> +TSPC_GATT_3_18	True		Client: Indications (M)
> +TSPC_GATT_3_19	True		Client: Read Characteristic Descriptors (C.1)
> +TSPC_GATT_3_20	True		Client: Read long Characteristic Descriptors
> +					(C.1)
> +TSPC_GATT_3_21	True		Client: Write Characteristic Descriptors (C.1)
> +TSPC_GATT_3_22	True		Client: Write Long Characteristic Descriptors
> +					(C.1)
> +TSPC_GATT_3_23	True		Client: Service Changed Characteristic (M)
> +TSPC_GATT_3B_1	True		Client: Primary Service Declaration (M)
> +TSPC_GATT_3B_2	True		Client: Secondary Service Declaration (M)
> +TSPC_GATT_3B_3	True		Client: Include Declaration (M)
> +TSPC_GATT_3B_4	True		Client: Characteristic Declaration (M)
> +TSPC_GATT_3B_5	True		Client: Characteristic Value Declaration (M)
> +TSPC_GATT_3B_6	True		Client: Characteristic Extended Properties (M)
> +TSPC_GATT_3B_7	True		Client: Characteristic User Description
> +					Descriptor (M)
> +TSPC_GATT_3B_8	True		Client: Client Characteristic Configuration
> +					Descriptor (M)
> +TSPC_GATT_3B_9	True		Client: Server Characteristic Configuration
> +					Descriptor (M)
> +TSPC_GATT_3B_10	True		Client: Characteristic Format Descriptor (M)
> +TSPC_GATT_3B_11	True		Client: Characteristic Aggregate Format
> +					Descriptor (M)
> +TSPC_GATT_3B_12	True		Client: Characteristic Format: Boolean (M)
> +TSPC_GATT_3B_13	True		Client: Characteristic Format: 2Bit (M)
> +TSPC_GATT_3B_14	True		Client: Characteristic Format: nibble (M)
> +TSPC_GATT_3B_15	True		Client: Characteristic Format: Uint8 (M)
> +TSPC_GATT_3B_16	True		Client: Characteristic Format: Uint12 (M)
> +TSPC_GATT_3B_17	True		Client: Characteristic Format: Uint16 (M)
> +TSPC_GATT_3B_18	True		Client: Characteristic Format: Uint24 (M)
> +TSPC_GATT_3B_19	True		Client: Characteristic Format: Uint32 (M)
> +TSPC_GATT_3B_20	True		Client: Characteristic Format: Uint48 (M)
> +TSPC_GATT_3B_21	True		Client: Characteristic Format: Uint64 (M)
> +TSPC_GATT_3B_22	True		Client: Characteristic Format: Uint128 (M)
> +TSPC_GATT_3B_23	True		Client: Characteristic Format: Sint8 (M)
> +TSPC_GATT_3B_24	True		Client: Characteristic Format: Sint12 (M)
> +TSPC_GATT_3B_25	True		Client: Characteristic Format: Sint16 (M)
> +TSPC_GATT_3B_26	True		Client: Characteristic Format: Sint24 (M)
> +TSPC_GATT_3B_27	True		Client: Characteristic Format: Sint32 (M)
> +TSPC_GATT_3B_28	True		Client: Characteristic Format: Sint48 (M)
> +TSPC_GATT_3B_29	True		Client: Characteristic Format: Sint64 (M)
> +TSPC_GATT_3B_30	True		Client: Characteristic Format: Sint128 (M)
> +TSPC_GATT_3B_31	True		Client: Characteristic Format: Float32 (M)
> +TSPC_GATT_3B_32	True		Client: Characteristic Format: Float64 (M)
> +TSPC_GATT_3B_33	True		Client: Characteristic Format: SFLOAT (M)
> +TSPC_GATT_3B_34	True		Client: Characteristic Format: FLOAT (M)
> +TSPC_GATT_3B_35	True		Client: Characteristic Format: Duint16 (M)
> +TSPC_GATT_3B_36	True		Client: Characteristic Format: utf8s (M)
> +TSPC_GATT_3B_37	True		Client: Characteristic Format: utf16s (M)
> +TSPC_GATT_3B_38	True		Client: Characteristic Format: struct (M)
> +-------------------------------------------------------------------------------
> +C.1: Mandatory IF TSPC_GATT_1A_1 is supported, otherwise Optional
> +-------------------------------------------------------------------------------
> +
> +
> +
> +		Generic Attribute Profile Support, by Server
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_GATT_4_1	True		Server: Exchange MTU (C.4)
> +TSPC_GATT_4_2	True		Server: Discover All Primary Services (M)
> +TSPC_GATT_4_3	True		Server: Discover Primary Services Service
> +					UUID (M)
> +TSPC_GATT_4_4	True		Server: Find Included Services (M)
> +TSPC_GATT_4_5	True		Server: Discover All characteristics of
> +					a Service (M)
> +TSPC_GATT_4_6	True		Server: Discover Characteristics by UUID (M)
> +TSPC_GATT_4_7	True		Server: Discover All Characteristic
> +					Descriptors (M)
> +TSPC_GATT_4_8	True		Server: Read Characteristic Value (M)
> +TSPC_GATT_4_9	True		Server: Read using Characteristic UUID (M)
> +TSPC_GATT_4_10	True		Server: Read Long Characteristic Values (C.4)
> +TSPC_GATT_4_11	True		Server: Read Multiple Characteristic
> +					Values (C.4)
> +TSPC_GATT_4_12	True		Server: Write without Response (C.2)
> +TSPC_GATT_4_13	False (*)	Server: Signed Write Without Response (C.4)
> +TSPC_GATT_4_14	True		Server: Write Characteristic Value (C.3)
> +TSPC_GATT_4_15	True		Server: Write Long Characteristic Values (C.4)
> +TSPC_GATT_4_16	True		Server: Characteristic Value Reliable
> +					Writes (C.4)
> +TSPC_GATT_4_17	True		Server: Notifications (C.4)
> +TSPC_GATT_4_18	True		Server: Indications (C.1)
> +TSPC_GATT_4_19	True		Server: Read Characteristic Descriptors (C.4)
> +TSPC_GATT_4_20	True		Server: Read long Characteristic
> +					Descriptors (C.4)
> +TSPC_GATT_4_21	True		Server: Write Characteristic Descriptors (C.4)
> +TSPC_GATT_4_22	True		Server: Write Long Characteristic
> +					Descriptors (C.4)
> +TSPC_GATT_4_23	True		Server: Service Changed Characteristic (C.1)
> +-------------------------------------------------------------------------------
> +C.1: Mandatory IF service definitions on the server can be added, changed, or
> +	removed, otherwise Optional
> +C.2: Mandatory IF GATT TSPC_GATT_4_13 is supported, otherwise Optional
> +C.3: Mandatory IF GATT TSPC_GATT_4_15 is supported, otherwise Optional
> +C.4: Mandatory IF GATT TSPC_GATT_1A_2 is supported, otherwise Optional
> +-------------------------------------------------------------------------------
> +
> +
> +		Profile Attribute Types and Characteristic Formats
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_GATT_4B_1	True		Server: Primary Service Declaration (M)
> +TSPC_GATT_4B_2	True		Server: Secondary Service Declaration (M)
> +TSPC_GATT_4B_3	True		Server: Include Declaration (M)
> +TSPC_GATT_4B_4	True		Server: Characteristic Declaration (M)
> +TSPC_GATT_4B_5	True		Server: Characteristic Value Declaration (M)
> +TSPC_GATT_4B_6	True		Server: Characteristic Extended Properties (M)
> +TSPC_GATT_4B_7	True		Server: Characteristic User Description
> +					Descriptor (M)
> +TSPC_GATT_4B_8	True		Server: Client Characteristic Configuration
> +					Descriptor (M)
> +TSPC_GATT_4B_9	True		Server: Server Characteristic Configuration
> +					Descriptor (M)
> +TSPC_GATT_4B_10	True		Server: Characteristic Format Descriptor (M)
> +TSPC_GATT_4B_11	True		Server: Characteristic Aggregate Format
> +					Descriptor (M)
> +TSPC_GATT_4B_12	True		Server: Characteristic Format: Boolean (M)
> +TSPC_GATT_4B_13	True		Server: Characteristic Format: 2Bit (M)
> +TSPC_GATT_4B_14	True		Server: Characteristic Format: nibble (M)
> +TSPC_GATT_4B_15	True		Server: Characteristic Format: Uint8 (M)
> +TSPC_GATT_4B_16	True		Server: Characteristic Format: Uint12 (M)
> +TSPC_GATT_4B_17	True		Server: Characteristic Format: Uint16 (M)
> +TSPC_GATT_4B_18	True		Server: Characteristic Format: Uint24 (M)
> +TSPC_GATT_4B_19	True		Server: Characteristic Format: Uint32 (M)
> +TSPC_GATT_4B_20	True		Server: Characteristic Format: Uint48 (M)
> +TSPC_GATT_4B_21	True		Server: Characteristic Format: Uint64 (M)
> +TSPC_GATT_4B_22	True		Server: Characteristic Format: Uint128 (M)
> +TSPC_GATT_4B_23	True		Server: Characteristic Format: Sint8 (M)
> +TSPC_GATT_4B_24	True		Server: Characteristic Format: Sint12 (M)
> +TSPC_GATT_4B_25	True		Server: Characteristic Format: Sint16 (M)
> +TSPC_GATT_4B_26	True		Server: Characteristic Format: Sint24 (M)
> +TSPC_GATT_4B_27	True		Server: Characteristic Format: Sint32 (M)
> +TSPC_GATT_4B_28	True		Server: Characteristic Format: Sint48 (M)
> +TSPC_GATT_4B_29	True		Server: Characteristic Format: Sint64 (M)
> +TSPC_GATT_4B_30	True		Server: Characteristic Format: Sint128 (M)
> +TSPC_GATT_4B_31	True		Server: Characteristic Format: Float32 (M)
> +TSPC_GATT_4B_32	True		Server: Characteristic Format: Float64 (M)
> +TSPC_GATT_4B_33	True		Server: Characteristic Format: SFLOAT (M)
> +TSPC_GATT_4B_34	True		Server: Characteristic Format: FLOAT (M)
> +TSPC_GATT_4B_35	True		Server: Characteristic Format: Duint16 (M)
> +TSPC_GATT_4B_36	True		Server: Characteristic Format: utf8s (M)
> +TSPC_GATT_4B_37	True		Server: Characteristic Format: utf16s (M)
> +TSPC_GATT_4B_38	True		Server: Characteristic Format: struct (M)
> +-------------------------------------------------------------------------------
> +
> +
> +		Generic Attribute Profile Service
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_GATT_6_2	True		Discover GATT Services using Service Discovery
> +					Profile (C.1)
> +TSPC_GATT_6_3	True		Publish SDP record for GATT services support
> +					via BR/EDR (C.2)
> +-------------------------------------------------------------------------------
> +C.1: Mandatory IF TSPC_GATT_1_1 is supported, otherwise Excluded
> +C.2: Mandatory IF TSPC_GATT_1_2 is supported, otherwise Excluded
> +-------------------------------------------------------------------------------
> +
> +
> +		Attribute Protocol Transport Security
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_GATT_7_1	True		Security Mode 4 (C.1)
> +TSPC_GATT_7_2	True		LE Security Mode 1 (C.2)
> +TSPC_GATT_7_3	True		LE Security Mode 2 (C.2)
> +TSPC_GATT_7_4	True		LE Authentication Procedure (C.2)
> +TSPC_GATT_7_5	True		LE connection data signing procedure (C.2)
> +TSPC_GATT_7_6	True		LE Authenticate signed data procedure (C.2)
> +TSPC_GATT_7_7	False (*)	LE Authorization Procedure (C.2)
> +-------------------------------------------------------------------------------
> +C.1: Mandatory IF TSPC_GATT_2_1 is supported, otherwise Excluded
> +C.2: Optional IF TSPC_GATT_2_2 is supported, otherwise Excluded
> +-------------------------------------------------------------------------------
> +
> +
> +		Attribute Protocol Client Messages
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_ATT_3_1	True		Attribute Error Response (M)
> +TSPC_ATT_3_2	False (*)	Exchange MTU Request (O)
> +TSPC_ATT_3_4	False (*)	Find Information Request (O)
> +TSPC_ATT_3_6	False (*)	Find by Type Value Request (O)
> +TSPC_ATT_3_8	False (*)	Read by Type Request (O)
> +TSPC_ATT_3_10	False (*)	Read Request (O)
> +TSPC_ATT_3_12	False (*)	Read Blob Request (O)
> +TSPC_ATT_3_14	False (*)	Read Multiple Request (O)
> +TSPC_ATT_3_16	False (*)	Read by Group Type Request (O)
> +TSPC_ATT_3_17	False (*)	Read by Group Type Response (C.6)
> +TSPC_ATT_3_18	False (*)	Write Request (O)
> +TSPC_ATT_3_20	False (*)	Write Command (O)
> +TSPC_ATT_3_21	False (*)	Signed Write Command (O)
> +TSPC_ATT_3_22	False (*)	Prepare Write Request (O)
> +TSPC_ATT_3_24	False (*)	Execute Write Request (C.8)
> +TSPC_ATT_3_26	True		Handle Value Notification (M)
> +-------------------------------------------------------------------------------
> +C.6: Mandatory IF TSPC_ATT_3_16 is supported, otherwise Excluded
> +C.8: Mandatory IF TSPC_ATT_3_22 is supported, otherwise Excluded
> +-------------------------------------------------------------------------------
> +
> +		Attribute Protocol Server Messages
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_ATT_4_1	True		Attribute Error Response (M)
> +TSPC_ATT_4_3	True		Exchange MTU Response (M)
> +TSPC_ATT_4_5	True		Find Information Response (M)
> +TSPC_ATT_4_7	True		Find by Type Value Response (M)
> +TSPC_ATT_4_8	True		Read by Type Request (M)
> +TSPC_ATT_4_9	True		Read by Type Response (M)
> +TSPC_ATT_4_11	True		Read Response (M)
> +TSPC_ATT_4_15	False (*)	Read Multiple Response (C.2)
> +TSPC_ATT_4_17	True		Read by Group Type Response (M)
> +TSPC_ATT_4_19	False (*)	Write Response (C.3)
> +TSPC_ATT_4_20	False (*)	Write Command (O)
> +TSPC_ATT_4_21	False (*)	Signed Write Command (O)
> +TSPC_ATT_4_23	False (*)	Prepare Write Response (C.4)
> +TSPC_ATT_4_25	False (*)	Execute Write Response (C.5)
> +TSPC_ATT_4_26	False (*)	Handle Value Notification (O)
> +-------------------------------------------------------------------------------
> +C.2: Mandatory IF TSPC_ATT_4_14 is supported, otherwise Excluded
> +C.3: Mandatory IF TSPC_ATT_4_18 is supported, otherwise Excluded
> +C.4: Mandatory IF TSPC_ATT_4_22 is supported, otherwise Excluded
> +C.5: Mandatory IF TSPC_ATT_4_27 is supported, otherwise Excluded
> +-------------------------------------------------------------------------------
> +
> +
> +		Attribute Protocol Transport
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_ATT_5_2	False (*)	LE Security Mode 1 (C.2)
> +TSPC_ATT_5_4	False (*)	LE Authentication Procedure (C.2)
> +TSPC_ATT_5_7	False (*)	LE Authorization Procedure (C.2)
> +-------------------------------------------------------------------------------
> +C.2: Optional to support if 2/2 (Attribute Protocol Supported over LE),
> +	otherwise Excluded
> +-------------------------------------------------------------------------------
> +
> +
> +		Device Configuration
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_GAP_0_2	False (*)	LE (C.2)
> +-------------------------------------------------------------------------------
> +C.2: Mandatory IF (SUM ICS 34/2 (LE GAP) AND NOT SUM ICS 32/3 (BR/EDR GAP))
> +	is supported, otherwise Excluded
> +-------------------------------------------------------------------------------
> diff --git a/android/pixit-gatt.txt b/android/pixit-gatt.txt
> new file mode 100644
> index 0000000..7bb8a28
> --- /dev/null
> +++ b/android/pixit-gatt.txt
> @@ -0,0 +1,31 @@
> +GATT PIXIT for the PTS tool.
> +
> +PTS version: 5.0
> +
> +* - different than PTS defaults
> +& - should be set to IUT Bluetooth address
> +
> +		Required PIXIT settings
> +-------------------------------------------------------------------------------
> +Parameter Name						Value
> +-------------------------------------------------------------------------------
> +TSPX_bd_addr_iut					112233445566 (*&)
> +TSPX_security_enabled					FALSE
> +TSPX_delete_link_key					TRUE
> +TSPX_time_guard						180000
> +TSPX_selected_handle					0012
> +TSPX_use_implicit_send					TRUE
> +TSPX_secure_simple_pairing_pass_key_confirmation	FALSE
> +TSPX_iut_use_dynamic_bd_addr				FALSE
> +TSPX_iut_setup_att_over_br_edr				FALSE
> +TSPX_tester_database_file				[Path to GATT Test
> +								Database]
> +TSPX_iut_is_client_periphral				FALSE
> +TSPX_iut_is_server_central				FALSE
> +TSPX_mtu_size						23
> +TSPX_pin_code						0000
> +TSPX_use_dynamic_pin					FALSE
> +TSPX_delete_ltk						FALSE
> +TSPX_characteristic_readable
> +TSPX_tester_appearance					0000
> +-------------------------------------------------------------------------------
> 

Applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH] android/pts: PAN PICS and PTS results
From: Szymon Janc @ 2014-03-06  8:47 UTC (permalink / raw)
  To: Sebastian Chlad; +Cc: linux-bluetooth
In-Reply-To: <1394089641-11398-1-git-send-email-sebastian.chlad@tieto.com>

Hi Sebastian,

On Thursday 06 of March 2014 08:07:21 Sebastian Chlad wrote:
> Adjusting some optional PICS settings as well as updating PTS
> test's results
> ---
>  android/pics-pan.txt | 42 +++++++++++++++++++++---------------------
>  android/pts-pan.txt  | 36 ++++++++++++++++++++++++------------
>  2 files changed, 45 insertions(+), 33 deletions(-)
> 
> diff --git a/android/pics-pan.txt b/android/pics-pan.txt
> index 16457bf..0caa629 100644
> --- a/android/pics-pan.txt
> +++ b/android/pics-pan.txt
> @@ -12,14 +12,14 @@ O - optional
>  -------------------------------------------------------------------------------
>  Parameter Name	Selected	Description
>  -------------------------------------------------------------------------------
> -TSPC_PAN_1_1	True (*#)	Role: Network Access Point (O.1)
> +TSPC_PAN_1_1	True (*)	Role: Network Access Point (O.1)
>  TSPC_PAN_1_2	False		Role: Group Ad-hoc Network (O.1)
> -TSPC_PAN_1_3	True (*#)	Role: PAN User (O.1)
> -TSPC_PAN_1a_1	True (#)	BNEP: BNEP Connection Setup (M)
> -TSPC_PAN_1a_2	True (#)	BNEP: BNEP Data Packet Reception (M)
> -TSPC_PAN_1a_3	True (#)	BNEP: BNEP Data Packet Transmission (M)
> -TSPC_PAN_1a_4	True (#)	BNEP: BNEP Control Message Processing (M)
> -TSPC_PAN_1a_5	True (#)	BNEP: BNEP Extension Header Processing (M)
> +TSPC_PAN_1_3	True (*)	Role: PAN User (O.1)
> +TSPC_PAN_1a_1	True		BNEP: BNEP Connection Setup (M)
> +TSPC_PAN_1a_2	True		BNEP: BNEP Data Packet Reception (M)
> +TSPC_PAN_1a_3	True		BNEP: BNEP Data Packet Transmission (M)
> +TSPC_PAN_1a_4	True		BNEP: BNEP Control Message Processing (M)
> +TSPC_PAN_1a_5	True		BNEP: BNEP Extension Header Processing (M)
>  TSPC_PAN_1a_6	False		BNEP: Network Protocol Filter Message
>  					Transmission (O)
>  TSPC_PAN_1a_7	False		BNEP: Multicast Address Filter Message
> @@ -33,21 +33,21 @@ O.1: It is mandatory to support at least one of the defined roles.
>  -------------------------------------------------------------------------------
>  Parameter Name	Selected	Description
>  -------------------------------------------------------------------------------
> -TSPC_PAN_2_1	True (#)	NAP: Support BNEP (M)
> -TSPC_PAN_2_2	True (#)	NAP: Support BNEP Forwarding (M)
> +TSPC_PAN_2_1	True		NAP: Support BNEP (M)
> +TSPC_PAN_2_2	True		NAP: Support BNEP Forwarding (M)
>  TSPC_PAN_2_3	False		NAP: Support Layer 2-Bridging between PAN and
>  					External Network (C.1)
> -TSPC_PAN_2_4	True (*#)	NAP: Support IP forwarding between PAN and
> +TSPC_PAN_2_4	True (*)	NAP: Support IP forwarding between PAN and
>  					External Network (C.1)
>  TSPC_PAN_2_5	False		NAP: Support BNEP Packet Filtering (O)
> -TSPC_PAN_2_6	True (*#)	NAP: Support IPv4 (C.2)
> -TSPC_PAN_2_6a	True (*#)	NAP: Supports operable routable IPv4 address (O)
> +TSPC_PAN_2_6	False		NAP: Support IPv4 (C.2)
> +TSPC_PAN_2_6a	False		NAP: Supports operable routable IPv4 address (O)
>  TSPC_PAN_2_6b	False		NAP: Support link-local address configuration
>  					for IPv4 (C.4)
>  TSPC_PAN_2_7	False		NAP: Support ping client for IPv4 (O)
>  TSPC_PAN_2_8	False		NAP: Support DHCP Client for IPv4 (O)
>  TSPC_PAN_2_9	False		NAP: Support DNS/LLMNR Resolver for IPv4 (O)
> -TSPC_PAN_2_9a	True (#)	NAP: Support LLMNR Sender for IPv4 (C.5)
> +TSPC_PAN_2_9a	False		NAP: Support LLMNR Sender for IPv4 (C.5)
>  TSPC_PAN_2_9b	False		NAP: Support LLMNR Responder for IPv4 (O)
>  TSPC_PAN_2_10	False		NAP: Support HTTP Client for IPv4 (O)
>  TSPC_PAN_2_11	False		NAP: Support WAP Client for IPv4 (O)
> @@ -58,8 +58,8 @@ TSPC_PAN_2_14a	False (*)	NAP: Support LLMNR Sender for IPv6 (C.6)
>  TSPC_PAN_2_14b	False		NAP: Support LLMNR Responder for IPv6 (O)
>  TSPC_PAN_2_15	False		NAP: Support HTTP Client for IPv6 (O)
>  TSPC_PAN_2_16	False		NAP: Support WAP Client for IPv6 (O)
> -TSPC_PAN_2_17	True (#)	NAP: Supports Connectable Mode (M)
> -TSPC_PAN_2_18	True (#)	NAP: NAP Service Record (M)
> +TSPC_PAN_2_17	True		NAP: Supports Connectable Mode (M)
> +TSPC_PAN_2_18	True		NAP: NAP Service Record (M)
>  TSPC_PAN_2_19	False		NAP: Support at least three PANUs (O)
>  TSPC_PAN_2_20	False		NAP: Support at least two PANUs (O)
>  -------------------------------------------------------------------------------
> @@ -73,7 +73,7 @@ C.3: Mandatory to support IF any IPv6-based transport protocol OR
>  	(TSPC_PAN_2_13-16) is supported, ELSE Optional.
>  C.4: Mandatory if TSPC_PAN_2_6 is supported and TSPC_PAN_2_6a is not supported,
>  	otherwise optional.
> -C.5: Mandatory if item (TSPC_PAN_2_6) or item supported.
> +C.5: Mandatory if item (TSPC_PAN_2_6) supported.
>  C.6: Mandatory if item (TSPC_PAN_2_12) supported
>  -------------------------------------------------------------------------------
>  
> @@ -119,12 +119,12 @@ C.4: Mandatory to support if (TSPC_PAN_3_10) is supported.
>  -------------------------------------------------------------------------------
>  Parameter Name	Selected	Description
>  -------------------------------------------------------------------------------
> -TSPC_PAN_4_1	True (#)	PANU: Support BNEP (M)
> -TSPC_PAN_4_2	True (*#)	PANU: Support IPv4 (C.1)
> -TSPC_PAN_4_3	True (*#)	PANU: Support ping client for IPv4 (O)
> -TSPC_PAN_4_4	True (*#)	PANU: Support DHCP client for  IPv4 (O)
> +TSPC_PAN_4_1	True		PANU: Support BNEP (M)
> +TSPC_PAN_4_2	True		PANU: Support IPv4 (C.1)
> +TSPC_PAN_4_3	False		PANU: Support ping client for IPv4 (O)
> +TSPC_PAN_4_4	False		PANU: Support DHCP client for  IPv4 (O)
>  TSPC_PAN_4_5	False		PANU: Support DNS/LLMNR Resolver for IPv4 (O)
> -TSPC_PAN_4_5a	True (#)	PANU: Support LLMNR Sender for IPv4 (C.2)
> +TSPC_PAN_4_5a	True		PANU: Support LLMNR Sender for IPv4 (C.2)
>  TSPC_PAN_4_5b	False		PANU: Support LLMNR Responder for IPv4 (O)
>  TSPC_PAN_4_6	False		PANU: Support HTTP Client for IPv4 (O)
>  TSPC_PAN_4_7	False		PANU: Support WAP Client for IPv4 (O)
> diff --git a/android/pts-pan.txt b/android/pts-pan.txt
> index 8e8ae41..74c482a 100644
> --- a/android/pts-pan.txt
> +++ b/android/pts-pan.txt
> @@ -10,9 +10,9 @@ FAIL	test failed
>  INC	test is inconclusive
>  N/A	test is disabled due to PICS setup
>  
> --------------------------------------------------------------------------------
> +--------------------------------------------------------------------------------
>  Test Name				Result	Notes
> --------------------------------------------------------------------------------
> +--------------------------------------------------------------------------------
>  TC_BNEP_GN_BROADCAST_0_BV_03_C		N/A
>  TC_GN_Ipv4_Autonet_BV_01_I		N/A
>  TC_GN_Ipv6_Autonet_BV_02_I		N/A
> @@ -34,37 +34,49 @@ TC_BNEP_NAP_FORWARD_UNICAST_BV_05_C	N/A
>  TC_BNEP_NAP_FORWARD_UNICAST_BV_06_C	N/A
>  TC_BNEP_NAP_MULTICAST_0_BV_03_C		N/A
>  TC_BNEP_NAP_MULTICAST_0_BV_04_C		N/A
> -TC_BNEP_BRIDGE_RX_BV_02_I		INC
> +TC_BNEP_BRIDGE_RX_BV_02_I		PASS	Tester needs to send one
> +						forward-unicast	BNEP packet
> +						with given data (5 times)
> +						0x00, 0x01, 0xFF followed by
> +						0x00, 0x01, 0x9E, 0x9F
> +						sendip -d <hexdata>
>  TC_BNEP_BRIDGE_TX_BV_01_I		PASS
>  TC_NAP_Ipv4_Autonet_BV_01_I		N/A
>  TC_NAP_Ipv6_Autonet_BV_02_I		N/A
>  TC_NAP_IP_DHCP_BV_03_I			N/A
> -TC_NAP_IP_LLMNR_BV_01_I			INC
> +TC_NAP_IP_LLMNR_BV_01_I			N/A
>  TC_NAP_IP_LLMNR_BV_02_I			N/A
>  TC_NAP_IP_DNS_BV_01_I			N/A
>  TC_NAP_IP_APP_BV_01_I			N/A
>  TC_NAP_IP_APP_BV_02_I			N/A
>  TC_NAP_IP_APP_BV_03_I			N/A
>  TC_NAP_IP_APP_BV_04_I			N/A
> -TC_NAP_IP_APP_BV_05_I			PASS
> +TC_NAP_IP_APP_BV_05_I			N/A
>  TC_SDP_NAP_BV_01_C			PASS
>  TC_MISC_NAP_UUID_BV_01_C		PASS
>  TC_MISC_NAP_UUID_BV_02_C		PASS
>  TC_BNEP_PANU_BROADCAST_0_BV_04_C	N/A
> -TC_PANU_Ipv4_Autonet_BV_01_I		INC
> +TC_PANU_Ipv4_Autonet_BV_01_I		PASS	When prompted connect to PTS.
> +						From IUT: issue ARP request
> +						iperf -c <addr> -p <port#>
>  TC_PANU_Ipv6_Autonet_BV_02_I		N/A
> -TC_PANU_IP_LLMNR_BV_01_I		INC
> +TC_PANU_IP_LLMNR_BV_01_I		PASS	When prompted connect to PTS.
> +						From IUT: send LLMNR request
> +						command
> +						iperf -c <addr> -p <port#>
>  TC_PANU_IP_LLMNR_BV_02_I		N/A
> -TC_PANU_IP_DHCP_BV_03_I			PASS
> +TC_PANU_IP_DHCP_BV_03_I			N/A
>  TC_PANU_IP_DNS_BV_01_I			N/A
>  TC_PANU_IP_APP_BV_01_I			N/A
>  TC_PANU_IP_APP_BV_02_I			N/A
> -TC_PANU_IP_APP_BV_03_I			INC
> -TC_PANU_IP_APP_BV_04_I			INC
> -TC_PANU_IP_APP_BV_05_I			PASS
> +TC_PANU_IP_APP_BV_03_I			N/A
> +TC_PANU_IP_APP_BV_04_I			N/A
> +TC_PANU_IP_APP_BV_05_I			PASS	When prompted, connect to PTS
> +						and then when prompted terminate
> +						connection (IUT side)
>  TC_SDP_PANU_BV_01_C			N/A
>  TC_MISC_PANU_UUID_BV_01_C		N/A
>  TC_MISC_PANU_UUID_BV_02_C		N/A
>  TC_MISC_ROLE_BV_01_C			N/A
>  TC_MISC_ROLE_BV_BV_02_C			N/A
> --------------------------------------------------------------------------------
> +--------------------------------------------------------------------------------
> 

Applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* [PATCHv2] android/pics: Change AVRCP to 1.5
From: Sebastian Chlad @ 2014-03-06  9:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sebastian Chlad

Simple PICS switch from AVRCP 1.3 to 1.5
---
 android/pics-avrcp.txt | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/android/pics-avrcp.txt b/android/pics-avrcp.txt
index 2be0746..845ba33 100644
--- a/android/pics-avrcp.txt
+++ b/android/pics-avrcp.txt
@@ -336,7 +336,7 @@ TSPC_AVRCP_7_5    True		TG: Receiving UNIT INFO (M)
 TSPC_AVRCP_7_6    True		TG: Receiving SUBUNIT INFO (M)
 TSPC_AVRCP_7_7    True		TG: Receiving PASS THROUGH command category 1
 					(C.1)
-TSPC_AVRCP_7_8    False		TG: Receiving PASS THROUGH command category 2
+TSPC_AVRCP_7_8    True (*)	TG: Receiving PASS THROUGH command category 2
 					(C.1)
 TSPC_AVRCP_7_9    False		TG: Receiving PASS THROUGH command category 3
 					(C.1)
@@ -405,9 +405,9 @@ TSPC_AVRCP_7_56   False		TG: PlayItem(NowPlayingList) (C.11)
 TSPC_AVRCP_7_57   False		TG: AddToNowPlaying (O)
 TSPC_AVRCP_7_58   False		TG: EVENT_NOW_PLAYING_CONTENT_CHANGED (C.11)
 TSPC_AVRCP_7_59   False		TG: Playable Folders (O)
-TSPC_AVRCP_7_60   False		TG: Absolute Volume (C.5)
-TSPC_AVRCP_7_61   False		TG: SetAbsoluteVolume (C.5)
-TSPC_AVRCP_7_62   False		TG: NotifyVolumeChange (C.5)
+TSPC_AVRCP_7_60   True (*)	TG: Absolute Volume (C.5)
+TSPC_AVRCP_7_61   True (*)	TG: SetAbsoluteVolume (C.5)
+TSPC_AVRCP_7_62   True (*)	TG: NotifyVolumeChange (C.5)
 TSPC_AVRCP_7_63   False		TG: Error Response (O)
 TSPC_AVRCP_7_64   False		TG: General Reject (C.13)
 TSPC_AVRCP_7_65   True		TG: Discoverable Mode (M)
@@ -448,9 +448,9 @@ C.15: Mandatory if Basic Group Navigation Feature supported. If any item
 Parameter Name    Selected	Description
 -------------------------------------------------------------------------------
 TSPC_AVRCP_7b_1   False		TG: AVRCP v1.0 (C.1)
-TSPC_AVRCP_7b_2   True (*)	TG: AVRCP v1.3 (C.1)
+TSPC_AVRCP_7b_2   False		TG: AVRCP v1.3 (C.1)
 TSPC_AVRCP_7b_3   False		TG: AVRCP v1.4 (C.1)
-TSPC_AVRCP_7b_4   False		TG: AVRCP v1.5 (C.1)
+TSPC_AVRCP_7b_4   True (*)	TG: AVRCP v1.5 (C.1)
 TSPC_AVRCP_7b_5   False		TG: AVRCP v1.6 (C.1)
 -------------------------------------------------------------------------------
 C.1: It is mandatory to support at least one of the profile versions.
@@ -523,8 +523,8 @@ TSPC_AVRCP_9_16   False		TG: category 2 - Operation id: display
 					information (O)
 TSPC_AVRCP_9_17	  False		TG: category 2 - Operation id: help (O)
 TSPC_AVRCP_9_18	  False		TG: category 2 - Operation id: power (O)
-TSPC_AVRCP_9_19   False (*)	TG: category 2 - Operation id: volume up (C.2)
-TSPC_AVRCP_9_20   False (*)	TG: category 2 - Operation id: volume down (C.2)
+TSPC_AVRCP_9_19   True		TG: category 2 - Operation id: volume up (C.2)
+TSPC_AVRCP_9_20   True		TG: category 2 - Operation id: volume down (C.2)
 TSPC_AVRCP_9_21   False		TG: category 2 - Operation id: mute (O)
 TSPC_AVRCP_9_24   False		TG: category 2 - Operation id: F1 (O)
 TSPC_AVRCP_9_25   False		TG: category 2 - Operation id: F2 (O)
-- 
1.8.5.3


^ permalink raw reply related

* Re: [PATCHv2 01/11] shared/hfp: Fix not freeing cmd_handler prefix
From: Szymon Janc @ 2014-03-06  9:21 UTC (permalink / raw)
  To: Marcin Kraglak; +Cc: linux-bluetooth
In-Reply-To: <1394047376-11495-1-git-send-email-marcin.kraglak@tieto.com>

Hi Marcin,

On Wednesday 05 of March 2014 20:22:46 Marcin Kraglak wrote:
> It should be freed while destroy.
> ---
>  src/shared/hfp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/shared/hfp.c b/src/shared/hfp.c
> index 08393d8..9523243 100644
> --- a/src/shared/hfp.c
> +++ b/src/shared/hfp.c
> @@ -82,6 +82,8 @@ static void destroy_cmd_handler(void *data)
>  	if (handler->destroy)
>  		handler->destroy(handler->user_data);
>  
> +	free(handler->prefix);
> +
>  	free(handler);
>  }
>  

All patches applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* [PATCH 1/3] android: Change property name for valgrind
From: Lukasz Rymanowski @ 2014-03-06  9:37 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lukasz Rymanowski

---
 android/bluetoothd-wrapper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/bluetoothd-wrapper.c b/android/bluetoothd-wrapper.c
index 122e6b0..3a9f32e 100644
--- a/android/bluetoothd-wrapper.c
+++ b/android/bluetoothd-wrapper.c
@@ -22,7 +22,7 @@
 
 #include <cutils/properties.h>
 
-#define PROPERTY_NAME "persist.sys.bluetooth.valgrind"
+#define PROPERTY_VALGRIND_NAME "persist.sys.bluetooth.valgrind"
 
 #define VALGRIND_BIN "/system/bin/valgrind"
 
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
 {
 	char value[PROPERTY_VALUE_MAX];
 
-	if (property_get(PROPERTY_NAME, value, "") > 0 &&
+	if (property_get(PROPERTY_VALGRIND_NAME, value, "") > 0 &&
 			(!strcasecmp(value, "true") || atoi(value) > 0))
 		run_valgrind();
 
-- 
1.8.4


^ permalink raw reply related

* [PATCH 2/3] android: Add possible to enable BlueZ debug logs
From: Lukasz Rymanowski @ 2014-03-06  9:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lukasz Rymanowski
In-Reply-To: <1394098681-18983-1-git-send-email-lukasz.rymanowski@tieto.com>

With this patch it is possible to enable BlueZ logs. In order
to enable it is required to set property:
persist.sys.bluetooth.debug to 1 or literaly "true".
More info in README
---
 android/README               | 11 +++++++++++
 android/bluetoothd-wrapper.c | 17 ++++++++++++-----
 android/main.c               |  8 +++++++-
 3 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/android/README b/android/README
index 3095383..b7ecf5f 100644
--- a/android/README
+++ b/android/README
@@ -130,6 +130,17 @@ will break at e.g. g_free() function without prior callers. It's possible to
 have proper library installed automatically by appropriate entry in Android.mk,
 see https://code.google.com/p/aosp-bluez.glib/ for an example.
 
+Enabling BlueZ debugs
+==============================
+
+BlueZ debug logs can be enabled in runtime by setting "persist.sys.bluetooth.debug"
+property to either literal "true" or any numeric value >0. For example:
+adb root
+adb shell setprop persist.sys.bluetooth.debug 1
+
+After changing property value Bluetooth needs to be restarted to apply changes.
+
+Note: Debugs are only available on NON USER build variants
 =============================
 Building and running on Linux
 =============================
diff --git a/android/bluetoothd-wrapper.c b/android/bluetoothd-wrapper.c
index 3a9f32e..56b8a78 100644
--- a/android/bluetoothd-wrapper.c
+++ b/android/bluetoothd-wrapper.c
@@ -24,6 +24,8 @@
 
 #define PROPERTY_VALGRIND_NAME "persist.sys.bluetooth.valgrind"
 
+#define PROPERTY_DEBUG_NAME "persist.sys.bluetooth.debug"
+
 #define VALGRIND_BIN "/system/bin/valgrind"
 
 #define BLUETOOTHD_BIN "/system/bin/bluetoothd-main"
@@ -45,13 +47,14 @@ static void run_valgrind(void)
 	execve(prg_argv[0], prg_argv, prg_envp);
 }
 
-static void run_bluetoothd(void)
+static void run_bluetoothd(int debug)
 {
-	char *prg_argv[2];
+	char *prg_argv[3];
 	char *prg_envp[1];
 
 	prg_argv[0] = BLUETOOTHD_BIN;
-	prg_argv[1] = NULL;
+	prg_argv[1] = debug ? "-d" : NULL;
+	prg_argv[2] = NULL;
 
 	prg_envp[0] = NULL;
 
@@ -61,16 +64,20 @@ static void run_bluetoothd(void)
 int main(int argc, char *argv[])
 {
 	char value[PROPERTY_VALUE_MAX];
+	int debug = 0;
 
 	if (property_get(PROPERTY_VALGRIND_NAME, value, "") > 0 &&
 			(!strcasecmp(value, "true") || atoi(value) > 0))
 		run_valgrind();
 
+	if (property_get(PROPERTY_DEBUG_NAME, value, "") > 0 &&
+			(!strcasecmp(value, "true") || atoi(value) > 0))
+			debug = 1;
+
 	/* In case we failed to execute Valgrind, try to run bluetoothd
 	 * without it
 	 */
-
-	run_bluetoothd();
+	run_bluetoothd(debug);
 
 	return 0;
 }
diff --git a/android/main.c b/android/main.c
index 42bc982..edec7dc 100644
--- a/android/main.c
+++ b/android/main.c
@@ -344,12 +344,15 @@ static guint setup_signalfd(void)
 
 static gboolean option_version = FALSE;
 static gint option_index = -1;
+static gboolean option_dbg = FALSE;
 
 static GOptionEntry options[] = {
 	{ "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
 				"Show version information and exit", NULL },
 	{ "index", 'i', 0, G_OPTION_ARG_INT, &option_index,
 				"Use specified controller", "INDEX"},
+	{ "debug", 'd', 0, G_OPTION_ARG_NONE, &option_dbg,
+				"Enable debug logs", NULL},
 	{ NULL }
 };
 
@@ -473,7 +476,10 @@ int main(int argc, char *argv[])
 	if (!signal)
 		return EXIT_FAILURE;
 
-	__btd_log_init("*", 0);
+	if (option_dbg)
+		__btd_log_init("*", 0);
+	else
+		__btd_log_init(NULL, 0);
 
 	if (!set_capabilities()) {
 		__btd_log_cleanup();
-- 
1.8.4


^ permalink raw reply related

* [PATCH 3/3] android: Enable mgmt debug logs
From: Lukasz Rymanowski @ 2014-03-06  9:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lukasz Rymanowski
In-Reply-To: <1394098681-18983-1-git-send-email-lukasz.rymanowski@tieto.com>

This patch introduce possibility to enable mgmt interface logs.
In order to enable it is required to set property:
persist.sys.bluetooth.mgmtdbg to 1 or literaly "true".
More info in README
---
 android/README               |  4 ++++
 android/bluetooth.c          | 11 ++++++++++-
 android/bluetooth.h          |  2 +-
 android/bluetoothd-wrapper.c | 18 ++++++++++++++----
 android/main.c               |  8 ++++++--
 5 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/android/README b/android/README
index b7ecf5f..6ee0c69 100644
--- a/android/README
+++ b/android/README
@@ -140,6 +140,10 @@ adb shell setprop persist.sys.bluetooth.debug 1
 
 After changing property value Bluetooth needs to be restarted to apply changes.
 
+There is also a possibility to enable mgmt debug logs which also enables debugs
+as above. To enable it procced in the same way as described above but use
+system properties called: persist.sys.bluetooth.mgmtdbg
+
 Note: Debugs are only available on NON USER build variants
 =============================
 Building and running on Linux
diff --git a/android/bluetooth.c b/android/bluetooth.c
index 6d94904..7736693 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -148,6 +148,12 @@ static GSList *browse_reqs;
 
 static struct ipc *hal_ipc = NULL;
 
+static void mgmt_debug(const char *str, void *user_data)
+{
+	const char *prefix = user_data;
+	info("%s%s", prefix, str);
+}
+
 static void store_adapter_config(void)
 {
 	GKeyFile *key_file;
@@ -2154,7 +2160,7 @@ failed:
 	cb(-EIO, NULL);
 }
 
-bool bt_bluetooth_start(int index, bt_bluetooth_ready cb)
+bool bt_bluetooth_start(int index, bool mgmt_dbg, bt_bluetooth_ready cb)
 {
 	DBG("index %d", index);
 
@@ -2164,6 +2170,9 @@ bool bt_bluetooth_start(int index, bt_bluetooth_ready cb)
 		return false;
 	}
 
+	if (mgmt_dbg)
+		mgmt_set_debug(mgmt_if, mgmt_debug, "mgmt_if: ", NULL);
+
 	if (mgmt_send(mgmt_if, MGMT_OP_READ_VERSION, MGMT_INDEX_NONE, 0, NULL,
 				read_version_complete, cb, NULL) == 0) {
 		error("Error sending READ_VERSION mgmt command");
diff --git a/android/bluetooth.h b/android/bluetooth.h
index 4731e2b..f436178 100644
--- a/android/bluetooth.h
+++ b/android/bluetooth.h
@@ -22,7 +22,7 @@
  */
 
 typedef void (*bt_bluetooth_ready)(int err, const bdaddr_t *addr);
-bool bt_bluetooth_start(int index, bt_bluetooth_ready cb);
+bool bt_bluetooth_start(int index, bool mgmt_dbg, bt_bluetooth_ready cb);
 
 typedef void (*bt_bluetooth_stopped)(void);
 bool bt_bluetooth_stop(bt_bluetooth_stopped cb);
diff --git a/android/bluetoothd-wrapper.c b/android/bluetoothd-wrapper.c
index 56b8a78..80c59c9 100644
--- a/android/bluetoothd-wrapper.c
+++ b/android/bluetoothd-wrapper.c
@@ -26,6 +26,8 @@
 
 #define PROPERTY_DEBUG_NAME "persist.sys.bluetooth.debug"
 
+#define PROPERTY_MGMT_DEBUG_NAME "persist.sys.bluetooth.mgmtdbg"
+
 #define VALGRIND_BIN "/system/bin/valgrind"
 
 #define BLUETOOTHD_BIN "/system/bin/bluetoothd-main"
@@ -47,14 +49,15 @@ static void run_valgrind(void)
 	execve(prg_argv[0], prg_argv, prg_envp);
 }
 
-static void run_bluetoothd(int debug)
+static void run_bluetoothd(int debug, int mgmt_dbg)
 {
-	char *prg_argv[3];
+	char *prg_argv[4];
 	char *prg_envp[1];
 
 	prg_argv[0] = BLUETOOTHD_BIN;
 	prg_argv[1] = debug ? "-d" : NULL;
-	prg_argv[2] = NULL;
+	prg_argv[2] = mgmt_dbg ? "--mgmt-debug" : NULL;
+	prg_argv[3] = NULL;
 
 	prg_envp[0] = NULL;
 
@@ -65,6 +68,7 @@ int main(int argc, char *argv[])
 {
 	char value[PROPERTY_VALUE_MAX];
 	int debug = 0;
+	int mgmt_dbg = 0;
 
 	if (property_get(PROPERTY_VALGRIND_NAME, value, "") > 0 &&
 			(!strcasecmp(value, "true") || atoi(value) > 0))
@@ -74,10 +78,16 @@ int main(int argc, char *argv[])
 			(!strcasecmp(value, "true") || atoi(value) > 0))
 			debug = 1;
 
+	if (property_get(PROPERTY_MGMT_DEBUG_NAME, value, "") > 0 &&
+			(!strcasecmp(value, "true") || atoi(value) > 0)) {
+			debug = 1;
+			mgmt_dbg = 1;
+	}
+
 	/* In case we failed to execute Valgrind, try to run bluetoothd
 	 * without it
 	 */
-	run_bluetoothd(debug);
+	run_bluetoothd(debug, mgmt_dbg);
 
 	return 0;
 }
diff --git a/android/main.c b/android/main.c
index edec7dc..a34f885 100644
--- a/android/main.c
+++ b/android/main.c
@@ -345,6 +345,7 @@ static guint setup_signalfd(void)
 static gboolean option_version = FALSE;
 static gint option_index = -1;
 static gboolean option_dbg = FALSE;
+static gboolean option_mgmt_dbg = FALSE;
 
 static GOptionEntry options[] = {
 	{ "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
@@ -353,6 +354,9 @@ static GOptionEntry options[] = {
 				"Use specified controller", "INDEX"},
 	{ "debug", 'd', 0, G_OPTION_ARG_NONE, &option_dbg,
 				"Enable debug logs", NULL},
+	{ "mgmt-debug", 0, 0, G_OPTION_ARG_NONE, &option_mgmt_dbg,
+				"Enable mgmt debug logs", NULL},
+
 	{ NULL }
 };
 
@@ -476,7 +480,7 @@ int main(int argc, char *argv[])
 	if (!signal)
 		return EXIT_FAILURE;
 
-	if (option_dbg)
+	if (option_dbg || option_mgmt_dbg)
 		__btd_log_init("*", 0);
 	else
 		__btd_log_init(NULL, 0);
@@ -496,7 +500,7 @@ int main(int argc, char *argv[])
 		return EXIT_FAILURE;
 	}
 
-	if (!bt_bluetooth_start(option_index, adapter_ready)) {
+	if (!bt_bluetooth_start(option_index, option_mgmt_dbg, adapter_ready)) {
 		__btd_log_cleanup();
 		g_source_remove(bluetooth_start_timeout);
 		g_source_remove(signal);
-- 
1.8.4


^ permalink raw reply related

* [PATCH 0/4] android: GATT HAL Implementation
From: Jakub Tyszkowski @ 2014-03-06 11:27 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

Patchset adds the initial implementation of Android GATT HAL. This will allow
to start the actual GATT Service development inside the Android daemon.

Jakub Tyszkowski (4):
  android/hal-gatt: Add Client Event handlers
  android/hal-gatt: Add Client API calls
  android/hal-gatt: Add Server Event handlers
  android/hal-gatt: Add Server API calls

 android/hal-gatt.c | 689 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 655 insertions(+), 34 deletions(-)

--
1.9.0


^ permalink raw reply

* [PATCH 1/4] android/hal-gatt: Add Client Event handlers
From: Jakub Tyszkowski @ 2014-03-06 11:27 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski
In-Reply-To: <1394105279-9165-1-git-send-email-jakub.tyszkowski@tieto.com>

Call registered handlers with data received through IPC.
---
 android/hal-gatt.c | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 170 insertions(+), 1 deletion(-)

diff --git a/android/hal-gatt.c b/android/hal-gatt.c
index 0e81a56..ce59f96 100644
--- a/android/hal-gatt.c
+++ b/android/hal-gatt.c
@@ -16,6 +16,7 @@
  */
 
 #include <stdbool.h>
+#include <string.h>
 
 #include "hal-log.h"
 #include "hal.h"
@@ -29,96 +30,264 @@ static bool interface_ready(void)
 	return cbs != NULL;
 }
 
+static void gatt_id_from_hal(btgatt_gatt_id_t *to,
+						struct hal_gatt_gatt_id *from)
+{
+	memcpy(&to->uuid, from->uuid, sizeof(to->uuid));
+	to->inst_id = from->inst_id;
+}
+
+static void srvc_id_from_hal(btgatt_srvc_id_t *to,
+						struct hal_gatt_srvc_id *from)
+{
+	memcpy(&to->id.uuid, from->uuid, sizeof(to->id.uuid));
+	to->id.inst_id = from->inst_id;
+	to->is_primary = from->is_primary;
+}
+
 /* Client Event Handlers */
 
 static void handle_register_client(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_register_client *ev = buf;
 
+	if (cbs->client->register_client_cb)
+		cbs->client->register_client_cb(ev->status, ev->client_if,
+						(bt_uuid_t *) ev->app_uuid);
 }
 
 static void handle_scan_result(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_scan_result *ev = buf;
 
+	if (cbs->client->scan_result_cb)
+		cbs->client->scan_result_cb((bt_bdaddr_t *) ev->bda, ev->rssi,
+								ev->adv_data);
 }
 
 static void handle_connect(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_connect *ev = buf;
 
+	if (cbs->client->open_cb)
+		cbs->client->open_cb(ev->conn_id, ev->status, ev->client_if,
+						(bt_bdaddr_t *) ev->bda);
 }
 
 static void handle_disconnect(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_disconnect *ev = buf;
 
+	if (cbs->client->close_cb)
+		cbs->client->close_cb(ev->conn_id, ev->status, ev->client_if,
+						(bt_bdaddr_t *) ev->bda);
 }
 
 static void handle_search_complete(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_search_complete *ev = buf;
 
+	if (cbs->client->search_complete_cb)
+		cbs->client->search_complete_cb(ev->conn_id, ev->status);
 }
 
 static void handle_search_result(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_search_result *ev = buf;
+
+	btgatt_srvc_id_t srvc_id;
+	srvc_id_from_hal(&srvc_id, &ev->srvc_id);
 
+	if (cbs->client->search_result_cb)
+		cbs->client->search_result_cb(ev->conn_id, &srvc_id);
 }
 
 static void handle_get_characteristic(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_get_characteristic *ev = buf;
+	btgatt_gatt_id_t char_id;
+	btgatt_srvc_id_t srvc_id;
 
+	srvc_id_from_hal(&srvc_id, &ev->srvc_id);
+	gatt_id_from_hal(&char_id, &ev->char_id);
+
+	if (cbs->client->get_characteristic_cb)
+		cbs->client->get_characteristic_cb(ev->conn_id, ev->status,
+							&srvc_id, &char_id,
+							ev->char_prop);
 }
 
 static void handle_get_descriptor(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_get_descriptor *ev = buf;
+	btgatt_gatt_id_t descr_id;
+	btgatt_gatt_id_t char_id;
+	btgatt_srvc_id_t srvc_id;
+
+	srvc_id_from_hal(&srvc_id, &ev->srvc_id);
+	gatt_id_from_hal(&char_id, &ev->char_id);
+	gatt_id_from_hal(&descr_id, &ev->descr_id);
 
+	if (cbs->client->get_descriptor_cb)
+		cbs->client->get_descriptor_cb(ev->conn_id, ev->status,
+						&srvc_id, &char_id, &descr_id);
 }
 
 static void handle_get_included_service(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_get_inc_service *ev = buf;
+	btgatt_srvc_id_t srvc_id;
+	btgatt_srvc_id_t incl_srvc_id;
 
+	srvc_id_from_hal(&srvc_id, &ev->srvc_id);
+	srvc_id_from_hal(&incl_srvc_id, &ev->incl_srvc_id);
+
+	if (cbs->client->get_included_service_cb)
+		cbs->client->get_included_service_cb(ev->conn_id, ev->status,
+								&srvc_id,
+								&incl_srvc_id);
 }
 
 static void handle_register_for_notification(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_reg_for_notif *ev = buf;
+	btgatt_gatt_id_t char_id;
+	btgatt_srvc_id_t srvc_id;
+
+	srvc_id_from_hal(&srvc_id, &ev->srvc_id);
+	gatt_id_from_hal(&char_id, &ev->char_id);
 
+	if (cbs->client->register_for_notification_cb)
+		cbs->client->register_for_notification_cb(ev->conn_id,
+								ev->registered,
+								ev->status,
+								&srvc_id,
+								&char_id);
 }
 
 static void handle_notify(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_notify *ev = buf;
+	btgatt_notify_params_t params;
+
+	memset(&params, 0, sizeof(params));
+	memcpy(params.value, ev->value, ev->len);
+	memcpy(&params.bda, ev->bda, sizeof(params.bda));
+
+	srvc_id_from_hal(&params.srvc_id, &ev->srvc_id);
+	gatt_id_from_hal(&params.char_id, &ev->char_id);
+
+	params.len = ev->len;
+	params.is_notify = ev->is_notify;
 
+	if (cbs->client->notify_cb)
+		cbs->client->notify_cb(ev->conn_id, &params);
 }
 
 static void handle_read_characteristic(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_read_characteristic *ev = buf;
+	btgatt_read_params_t params;
 
+	memset(&params, 0, sizeof(params));
+
+	srvc_id_from_hal(&params.srvc_id, &ev->data.srvc_id);
+	gatt_id_from_hal(&params.char_id, &ev->data.char_id);
+	gatt_id_from_hal(&params.descr_id, &ev->data.descr_id);
+
+	memcpy(&params.value.value, ev->data.value, ev->data.len);
+
+	params.value_type = ev->data.value_type;
+	params.value.len = ev->data.len;
+	params.status = ev->data.status;
+
+	if (cbs->client->read_characteristic_cb)
+		cbs->client->read_characteristic_cb(ev->conn_id, ev->status,
+								&params);
 }
 
 static void handle_write_characteristic(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_write_characteristic *ev = buf;
+	btgatt_write_params_t params;
+
+	memset(&params, 0, sizeof(params));
+
+	srvc_id_from_hal(&params.srvc_id, &ev->data.srvc_id);
+	gatt_id_from_hal(&params.char_id, &ev->data.char_id);
+	gatt_id_from_hal(&params.descr_id, &ev->data.descr_id);
+
+	params.status = ev->data.status;
 
+	if (cbs->client->write_characteristic_cb)
+		cbs->client->write_characteristic_cb(ev->conn_id, ev->status,
+								&params);
 }
 
 static void handle_read_descriptor(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_read_descriptor *ev = buf;
+	btgatt_read_params_t params;
 
+	memset(&params, 0, sizeof(params));
+
+	srvc_id_from_hal(&params.srvc_id, &ev->data.srvc_id);
+	gatt_id_from_hal(&params.char_id, &ev->data.char_id);
+	gatt_id_from_hal(&params.descr_id, &ev->data.descr_id);
+
+	memcpy(&params.value.value, ev->data.value, ev->data.len);
+
+	params.value_type = ev->data.value_type;
+	params.value.len = ev->data.len;
+	params.status = ev->data.status;
+
+	if (cbs->client->read_descriptor_cb)
+		cbs->client->read_descriptor_cb(ev->conn_id, ev->status,
+								&params);
 }
 
 static void handle_write_descriptor(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_write_descriptor *ev = buf;
+	btgatt_write_params_t params;
+
+	memset(&params, 0, sizeof(params));
+
+	srvc_id_from_hal(&params.srvc_id, &ev->data.srvc_id);
+	gatt_id_from_hal(&params.char_id, &ev->data.char_id);
+	gatt_id_from_hal(&params.descr_id, &ev->data.descr_id);
+
+	params.status = ev->data.status;
 
+	if (cbs->client->write_descriptor_cb)
+		cbs->client->write_descriptor_cb(ev->conn_id, ev->status,
+								&params);
 }
 
 static void handle_execute_write(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_exec_write *ev = buf;
 
+	if (cbs->client->execute_write_cb)
+		cbs->client->execute_write_cb(ev->conn_id, ev->status);
 }
 
 static void handle_read_remote_rssi(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_read_remote_rssi *ev = buf;
 
+	if (cbs->client->read_remote_rssi_cb)
+		cbs->client->read_remote_rssi_cb(ev->client_if,
+						(bt_bdaddr_t *) ev->address,
+						ev->rssi, ev->status);
 }
 
 static void handle_listen(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_client_listen *ev = buf;
 
+	if (cbs->client->listen_cb)
+		cbs->client->listen_cb(ev->status, ev->server_if);
 }
 
 /* Server Event Handlers */
@@ -217,7 +386,7 @@ static const struct hal_ipc_handler ev_handlers[] = {
 			sizeof(struct hal_ev_gatt_client_read_characteristic)},
 	{handle_write_characteristic, false,
 			sizeof(struct hal_ev_gatt_client_write_characteristic)},
-	{handle_read_descriptor, false,
+	{handle_read_descriptor, true,
 			sizeof(struct hal_ev_gatt_client_read_descriptor)},
 	{handle_write_descriptor, false,
 			sizeof(struct hal_ev_gatt_client_write_descriptor)},
-- 
1.9.0


^ permalink raw reply related

* [PATCH 2/4] android/hal-gatt: Add Client API calls
From: Jakub Tyszkowski @ 2014-03-06 11:27 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski
In-Reply-To: <1394105279-9165-1-git-send-email-jakub.tyszkowski@tieto.com>

Send API calls data using IPC.
---
 android/hal-gatt.c | 308 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 287 insertions(+), 21 deletions(-)

diff --git a/android/hal-gatt.c b/android/hal-gatt.c
index ce59f96..83b6303 100644
--- a/android/hal-gatt.c
+++ b/android/hal-gatt.c
@@ -21,7 +21,9 @@
 #include "hal-log.h"
 #include "hal.h"
 #include "hal-msg.h"
+#include "ipc-common.h"
 #include "hal-ipc.h"
+#include "hal-utils.h"
 
 static const btgatt_callbacks_t *cbs = NULL;
 
@@ -37,6 +39,12 @@ static void gatt_id_from_hal(btgatt_gatt_id_t *to,
 	to->inst_id = from->inst_id;
 }
 
+static void gatt_id_to_hal(struct hal_gatt_gatt_id *to, btgatt_gatt_id_t *from)
+{
+	memcpy(to->uuid, &from->uuid, sizeof(from->uuid));
+	to->inst_id = from->inst_id;
+}
+
 static void srvc_id_from_hal(btgatt_srvc_id_t *to,
 						struct hal_gatt_srvc_id *from)
 {
@@ -45,6 +53,13 @@ static void srvc_id_from_hal(btgatt_srvc_id_t *to,
 	to->is_primary = from->is_primary;
 }
 
+static void srvc_id_to_hal(struct hal_gatt_srvc_id *to, btgatt_srvc_id_t *from)
+{
+	memcpy(to->uuid, &from->id.uuid, sizeof(from->id.uuid));
+	to->inst_id = from->id.inst_id;
+	to->is_primary = from->is_primary;
+}
+
 /* Client Event Handlers */
 
 static void handle_register_client(void *buf, uint16_t len)
@@ -429,70 +444,196 @@ static const struct hal_ipc_handler ev_handlers[] = {
 
 static bt_status_t register_client(bt_uuid_t *uuid)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_register cmd;
+
+	memcpy(cmd.uuid, uuid, sizeof(*uuid));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_REGISTER,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t unregister_client(int client_if)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_unregister cmd;
+
+	cmd.client_if = client_if;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_UNREGISTER,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t scan(int client_if, bool start)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_scan cmd;
+
+	cmd.client_if = client_if;
+	cmd.start = start;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_SCAN,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t connect(int client_if, const bt_bdaddr_t *bd_addr,
 								bool is_direct)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_connect cmd;
+
+	cmd.client_if = client_if;
+	cmd.is_direct = is_direct;
+
+	memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_CONNECT,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t disconnect(int client_if, const bt_bdaddr_t *bd_addr,
 								int conn_id)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_disconnect cmd;
+
+	cmd.client_if = client_if;
+	cmd.conn_id = conn_id;
+
+	memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_DISCONNECT,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t listen(int client_if, bool start)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_listen cmd;
+
+	cmd.client_if = client_if;
+	cmd.start = start;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_LISTEN,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t refresh(int client_if, const bt_bdaddr_t *bd_addr)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_refresh cmd;
+
+	cmd.client_if = client_if;
+
+	memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_REFRESH,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t search_service(int conn_id, bt_uuid_t *filter_uuid)
 {
-	return BT_STATUS_UNSUPPORTED;
+	char buf[IPC_MTU];
+	struct hal_cmd_gatt_client_search_service *cmd = (void *) buf;
+	size_t len = sizeof(*cmd);
+
+	memset(cmd, 0, sizeof(*cmd));
+
+	cmd->conn_id = conn_id;
+
+	if (filter_uuid) {
+		memcpy(cmd->filter_uuid, filter_uuid, sizeof(*filter_uuid));
+		len += sizeof(*filter_uuid);
+		cmd->number = 1;
+	}
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_SEARCH_SERVICE,
+					len, cmd, 0, NULL, NULL);
 }
 
 static bt_status_t get_included_service(int conn_id, btgatt_srvc_id_t *srvc_id,
 					btgatt_srvc_id_t *start_incl_srvc_id)
 {
-	return BT_STATUS_UNSUPPORTED;
+	char buf[IPC_MTU];
+	struct hal_cmd_gatt_client_get_included_service *cmd = (void *) buf;
+	size_t len = sizeof(*cmd);
+
+	cmd->conn_id = conn_id;
+
+	srvc_id_to_hal(&cmd->srvc_id[0], srvc_id);
+	len += sizeof(cmd->srvc_id[0]);
+	cmd->number = 1;
+
+	if (start_incl_srvc_id) {
+		srvc_id_to_hal(&cmd->srvc_id[1], start_incl_srvc_id);
+		len += sizeof(cmd->srvc_id[1]);
+		cmd->number++;
+	}
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_GET_INCLUDED_SERVICE,
+					len, cmd, 0, NULL, NULL);
 }
 
 static bt_status_t get_characteristic(int conn_id, btgatt_srvc_id_t *srvc_id,
 						btgatt_gatt_id_t *start_char_id)
 {
-	return BT_STATUS_UNSUPPORTED;
+	char buf[IPC_MTU];
+	struct hal_cmd_gatt_client_get_characteristic *cmd = (void *) buf;
+	size_t len = sizeof(*cmd);
+
+	cmd->conn_id = conn_id;
+
+	srvc_id_to_hal(&cmd->srvc_id, srvc_id);
+	len += sizeof(cmd->srvc_id);
+
+	if (start_char_id) {
+		gatt_id_to_hal(&cmd->gatt_id[0], start_char_id);
+		len += sizeof(cmd->gatt_id[0]);
+		cmd->number = 1;
+	}
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_GET_CHARACTERISTIC,
+					len, cmd, 0, NULL, NULL);
 }
 
 static bt_status_t get_descriptor(int conn_id, btgatt_srvc_id_t *srvc_id,
 					btgatt_gatt_id_t *char_id,
 					btgatt_gatt_id_t *start_descr_id)
 {
-	return BT_STATUS_UNSUPPORTED;
+	char buf[IPC_MTU];
+	struct hal_cmd_gatt_client_get_descriptor *cmd = (void *) buf;
+	size_t len = sizeof(*cmd);
+
+	cmd->conn_id = conn_id;
+
+	srvc_id_to_hal(&cmd->srvc_id, srvc_id);
+
+	gatt_id_to_hal(&cmd->gatt_id[0], char_id);
+	len += sizeof(cmd->gatt_id[0]);
+	cmd->number = 1;
+
+	if (start_descr_id) {
+		gatt_id_to_hal(&cmd->gatt_id[1], char_id);
+		len += sizeof(cmd->gatt_id[1]);
+		cmd->number++;
+	}
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_GET_DESCRIPTOR,
+					len, &cmd, 0 , NULL, NULL);
 }
 
 static bt_status_t read_characteristic(int conn_id, btgatt_srvc_id_t *srvc_id,
 					btgatt_gatt_id_t *char_id,
 					int auth_req)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_read_characteristic cmd;
+
+	cmd.conn_id = conn_id;
+	cmd.auth_req = auth_req;
+
+	srvc_id_to_hal(&cmd.srvc_id, srvc_id);
+	gatt_id_to_hal(&cmd.gatt_id, char_id);
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_READ_CHARACTERISTIC,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t write_characteristic(int conn_id, btgatt_srvc_id_t *srvc_id,
@@ -500,7 +641,23 @@ static bt_status_t write_characteristic(int conn_id, btgatt_srvc_id_t *srvc_id,
 					int write_type, int len, int auth_req,
 					char *p_value)
 {
-	return BT_STATUS_UNSUPPORTED;
+	char buf[IPC_MTU];
+	struct hal_cmd_gatt_client_write_characteristic *cmd = (void *) buf;
+	size_t cmd_len = sizeof(*cmd) + len;
+
+	cmd->conn_id = conn_id;
+	cmd->write_type = write_type;
+	cmd->len = len;
+	cmd->auth_req = auth_req;
+
+	srvc_id_to_hal(&cmd->srvc_id, srvc_id);
+	gatt_id_to_hal(&cmd->gatt_id, char_id);
+
+	memcpy(cmd->value, p_value, len);
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_WRITE_CHARACTERISTIC,
+					cmd_len, cmd, 0, NULL, NULL);
 }
 
 static bt_status_t read_descriptor(int conn_id, btgatt_srvc_id_t *srvc_id,
@@ -508,6 +665,19 @@ static bt_status_t read_descriptor(int conn_id, btgatt_srvc_id_t *srvc_id,
 						btgatt_gatt_id_t *descr_id,
 						int auth_req)
 {
+	struct hal_cmd_gatt_client_read_descriptor cmd;
+
+	cmd.conn_id = conn_id;
+	cmd.auth_req = auth_req;
+
+	srvc_id_to_hal(&cmd.srvc_id, srvc_id);
+	gatt_id_to_hal(&cmd.char_id, char_id);
+	gatt_id_to_hal(&cmd.descr_id, descr_id);
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_READ_DESCRIPTOR,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
+
 	return BT_STATUS_UNSUPPORTED;
 }
 
@@ -517,12 +687,36 @@ static bt_status_t write_descriptor(int conn_id, btgatt_srvc_id_t *srvc_id,
 					int write_type, int len, int auth_req,
 					char *p_value)
 {
-	return BT_STATUS_UNSUPPORTED;
+	char buf[IPC_MTU];
+	struct hal_cmd_gatt_client_write_descriptor *cmd = (void *) buf;
+	size_t cmd_len = sizeof(*cmd) + len;
+
+	cmd->conn_id = conn_id;
+	cmd->write_type = write_type;
+	cmd->len = len;
+	cmd->auth_req = auth_req;
+
+	srvc_id_to_hal(&cmd->srvc_id, srvc_id);
+	gatt_id_to_hal(&cmd->char_id, char_id);
+	gatt_id_to_hal(&cmd->descr_id, descr_id);
+
+	memcpy(cmd->value, p_value, len);
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_WRITE_DESCRIPTOR,
+					cmd_len, cmd, 0, NULL, NULL);
 }
 
 static bt_status_t execute_write(int conn_id, int execute)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_execute_write cmd;
+
+	cmd.conn_id = conn_id;
+	cmd.execute = execute;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_EXECUTE_WRITE,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t register_for_notification(int client_if,
@@ -530,7 +724,18 @@ static bt_status_t register_for_notification(int client_if,
 						btgatt_srvc_id_t *srvc_id,
 						btgatt_gatt_id_t *char_id)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_register_for_notification cmd;
+
+	cmd.client_if = client_if;
+
+	memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr));
+
+	srvc_id_to_hal(&cmd.srvc_id, srvc_id);
+	gatt_id_to_hal(&cmd.char_id, char_id);
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+				HAL_OP_GATT_CLIENT_REGISTER_FOR_NOTIFICATION,
+				sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t deregister_for_notification(int client_if,
@@ -538,17 +743,48 @@ static bt_status_t deregister_for_notification(int client_if,
 						btgatt_srvc_id_t *srvc_id,
 						btgatt_gatt_id_t *char_id)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_deregister_for_notification cmd;
+
+	cmd.client_if = client_if;
+
+	memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr));
+
+	srvc_id_to_hal(&cmd.srvc_id, srvc_id);
+	gatt_id_to_hal(&cmd.char_id, char_id);
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+				HAL_OP_GATT_CLIENT_DEREGISTER_FOR_NOTIFICATION,
+				sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t read_remote_rssi(int client_if, const bt_bdaddr_t *bd_addr)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_read_remote_rssi cmd;
+
+	cmd.client_if = client_if;
+
+	memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_READ_REMOTE_RSSI,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static int get_device_type(const bt_bdaddr_t *bd_addr)
 {
-	return 0;
+	struct hal_cmd_gatt_client_get_device_type cmd;
+	uint8_t dev_type = 0;
+	size_t resp_len = sizeof(dev_type);
+
+	memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr));
+
+	hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_GET_DEVICE_TYPE,
+			sizeof(cmd), &cmd, &resp_len, &dev_type, NULL);
+
+	if (resp_len != sizeof(dev_type))
+		return 0;
+
+	return dev_type;
 }
 
 static bt_status_t set_adv_data(int server_if, bool set_scan_rsp,
@@ -557,12 +793,42 @@ static bt_status_t set_adv_data(int server_if, bool set_scan_rsp,
 				int appearance, uint16_t manufacturer_len,
 				char *manufacturer_data)
 {
-	return BT_STATUS_UNSUPPORTED;
+	char buf[IPC_MTU];
+	struct hal_cmd_gatt_client_set_adv_data *cmd = (void *) buf;
+	size_t cmd_len = sizeof(*cmd) + manufacturer_len;
+
+	cmd->server_if = server_if;
+	cmd->set_scan_rsp = set_scan_rsp;
+	cmd->include_name = include_name;
+	cmd->include_txpower = include_txpower;
+	cmd->min_interval = min_interval;
+	cmd->max_interval = max_interval;
+	cmd->appearance = appearance;
+	cmd->manufacturer_len = manufacturer_len;
+
+	memcpy(cmd->manufacturer_data, manufacturer_data, manufacturer_len);
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_SET_ADV_DATA,
+						cmd_len, cmd, 0, NULL, NULL);
 }
 
 static bt_status_t test_command(int command, btgatt_test_params_t *params)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_client_test_command cmd;
+
+	cmd.command = command;
+
+	memcpy(cmd.bda1, params->bda1, sizeof(*params->bda1));
+	memcpy(cmd.uuid1, params->uuid1, sizeof(*params->uuid1));
+
+	cmd.u1 = params->u1;
+	cmd.u2 = params->u2;
+	cmd.u3 = params->u3;
+	cmd.u4 = params->u4;
+	cmd.u5 = params->u5;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_TEST_COMMAND,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 /* Server API */
-- 
1.9.0


^ permalink raw reply related

* [PATCH 3/4] android/hal-gatt: Add Server Event handlers
From: Jakub Tyszkowski @ 2014-03-06 11:27 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski
In-Reply-To: <1394105279-9165-1-git-send-email-jakub.tyszkowski@tieto.com>

Call registered handlers with data received through IPC.
---
 android/hal-gatt.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/android/hal-gatt.c b/android/hal-gatt.c
index 83b6303..37c0191 100644
--- a/android/hal-gatt.c
+++ b/android/hal-gatt.c
@@ -309,67 +309,135 @@ static void handle_listen(void *buf, uint16_t len)
 
 static void handle_register_server(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_register *ev = buf;
 
+	if (cbs->server->register_server_cb)
+		cbs->server->register_server_cb(ev->status, ev->server_if,
+						(bt_uuid_t *) &ev->uuid);
 }
 
 static void handle_connection(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_connection *ev = buf;
 
+	if (cbs->server->connection_cb)
+		cbs->server->connection_cb(ev->conn_id, ev->server_if,
+						ev->connected,
+						(bt_bdaddr_t *) &ev->bdaddr);
 }
 
 static void handle_service_added(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_service_added *ev = buf;
+	btgatt_srvc_id_t srvc_id;
+
+	srvc_id_from_hal(&srvc_id, &ev->srvc_id);
 
+	if (cbs->server->service_added_cb)
+		cbs->server->service_added_cb(ev->status, ev->server_if,
+						&srvc_id, ev->srvc_handle);
 }
 
 static void handle_included_service_added(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_inc_srvc_added *ev = buf;
 
+	if (cbs->server->included_service_added_cb)
+		cbs->server->included_service_added_cb(ev->status,
+							ev->server_if,
+							ev->srvc_handle,
+							ev->incl_srvc_handle);
 }
 
 static void handle_characteristic_added(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_characteristic_added *ev = buf;
 
+	if (cbs->server->characteristic_added_cb)
+		cbs->server->characteristic_added_cb(ev->status, ev->server_if,
+							(bt_uuid_t *) &ev->uuid,
+							ev->srvc_handle,
+							ev->char_handle);
 }
 
 static void handle_descriptor_added(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_descriptor_added *ev = buf;
 
+	if (cbs->server->descriptor_added_cb)
+		cbs->server->descriptor_added_cb(ev->status, ev->server_if,
+							(bt_uuid_t *) &ev->uuid,
+							ev->srvc_handle,
+							ev->descr_handle);
 }
 
 static void handle_service_started(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_service_started *ev = buf;
 
+	if (cbs->server->service_started_cb)
+		cbs->server->service_started_cb(ev->status, ev->server_if,
+							ev->srvc_handle);
 }
 
 static void handle_service_stopped(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_service_stopped *ev = buf;
 
+	if (cbs->server->service_stopped_cb)
+		cbs->server->service_stopped_cb(ev->status, ev->server_if,
+							ev->srvc_handle);
 }
 
 static void handle_service_deleted(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_service_deleted *ev = buf;
 
+	if (cbs->server->service_deleted_cb)
+		cbs->server->service_deleted_cb(ev->status, ev->server_if,
+							ev->srvc_handle);
 }
 
 static void handle_request_read(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_request_read *ev = buf;
 
+	if (cbs->server->request_read_cb)
+		cbs->server->request_read_cb(ev->conn_id, ev->trans_id,
+						(bt_bdaddr_t *) &ev->bdaddr,
+						ev->attr_handle, ev->offset,
+						ev->is_long);
 }
 
 static void handle_request_write(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_request_write *ev = buf;
 
+	if (cbs->server->request_write_cb)
+		cbs->server->request_write_cb(ev->conn_id, ev->trans_id,
+						(bt_bdaddr_t *) ev->bdaddr,
+						ev->attr_handle, ev->offset,
+						ev->length, ev->need_rsp,
+						ev->is_prep, ev->value);
 }
 
 static void handle_request_exec_write(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_request_exec_write *ev = buf;
+
+	if (cbs->server->request_exec_write_cb)
+		cbs->server->request_exec_write_cb(ev->conn_id, ev->trans_id,
+						(bt_bdaddr_t *) ev->bdaddr,
+						ev->exec_write);
 
 }
 
 static void handle_response_confirmation(void *buf, uint16_t len)
 {
+	struct hal_ev_gatt_server_rsp_confirmation *ev = buf;
 
+	if (cbs->server->response_confirmation_cb)
+		cbs->server->response_confirmation_cb(ev->status, ev->handle);
 }
 
 /* handlers will be called from notification thread context,
-- 
1.9.0


^ permalink raw reply related

* [PATCH 4/4] android/hal-gatt: Add Server API calls
From: Jakub Tyszkowski @ 2014-03-06 11:27 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski
In-Reply-To: <1394105279-9165-1-git-send-email-jakub.tyszkowski@tieto.com>

Send API calls data using IPC.
---
 android/hal-gatt.c | 142 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 130 insertions(+), 12 deletions(-)

diff --git a/android/hal-gatt.c b/android/hal-gatt.c
index 37c0191..065c2f8 100644
--- a/android/hal-gatt.c
+++ b/android/hal-gatt.c
@@ -903,72 +903,189 @@ static bt_status_t test_command(int command, btgatt_test_params_t *params)
 
 static bt_status_t register_server(bt_uuid_t *uuid)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_register cmd;
+
+	memcpy(cmd.uuid, uuid, sizeof(*uuid));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_REGISTER,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t unregister_server(int server_if)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_unregister cmd;
+
+	cmd.server_if = server_if;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_UNREGISTER,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t server_connect(int server_if, const bt_bdaddr_t *bd_addr,
 								bool is_direct)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_connect cmd;
+
+	cmd.server_if = server_if;
+	cmd.is_direct = is_direct;
+
+	memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_CONNECT,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
+}
+
+static bt_status_t server_disconnect(int server_if, const bt_bdaddr_t *bd_addr,
+								int conn_id)
+{
+	struct hal_cmd_gatt_server_disconnect cmd;
+
+	cmd.server_if = server_if;
+	cmd.conn_id = conn_id;
+
+	memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_DISCONNECT,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t add_service(int server_if, btgatt_srvc_id_t *srvc_id,
 								int num_handles)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_add_service cmd;
+
+	cmd.server_if = server_if;
+	cmd.num_handles = num_handles;
+
+	srvc_id_to_hal(&cmd.srvc_id, srvc_id);
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_ADD_SERVICE,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t add_included_service(int server_if, int service_handle,
 						int included_handle)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_add_inc_service cmd;
+
+	cmd.server_if = server_if;
+	cmd.service_handle = service_handle;
+	cmd.included_handle = included_handle;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_SERVER_ADD_INC_SERVICE,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t add_characteristic(int server_if, int service_handle,
 						bt_uuid_t *uuid, int properties,
 						int permissions)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_add_characteristic cmd;
+
+	cmd.server_if = server_if;
+	cmd.service_handle = service_handle;
+	cmd.properties = properties;
+	cmd.permissions = permissions;
+
+	memcpy(cmd.uuid, uuid, sizeof(*uuid));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_SERVER_ADD_CHARACTERISTIC,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t add_descriptor(int server_if, int service_handle,
 					bt_uuid_t *uuid, int permissions)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_add_descriptor cmd;
+
+	cmd.server_if = server_if;
+	cmd.service_handle = service_handle;
+	cmd.permissions = permissions;
+
+	memcpy(cmd.uuid, uuid, sizeof(*uuid));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_SERVER_ADD_DESCRIPTOR,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t start_service(int server_if, int service_handle,
 								int transport)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_start_service cmd;
+
+	cmd.server_if = server_if;
+	cmd.service_handle = service_handle;
+	cmd.transport = transport;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_SERVER_START_SERVICE,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t stop_service(int server_if, int service_handle)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_stop_service cmd;
+
+	cmd.server_if = server_if;
+	cmd.service_handle = service_handle;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_STOP_SERVICE,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t delete_service(int server_if, int service_handle)
 {
-	return BT_STATUS_UNSUPPORTED;
+	struct hal_cmd_gatt_server_delete_service cmd;
+
+	cmd.server_if = server_if;
+	cmd.service_handle = service_handle;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_SERVER_DELETE_SERVICE,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t send_indication(int server_if, int attribute_handle,
 					int conn_id, int len, int confirm,
 					char *p_value)
 {
-	return BT_STATUS_UNSUPPORTED;
+	char buf[IPC_MTU];
+	struct hal_cmd_gatt_server_send_indication *cmd = (void *) buf;
+	size_t cmd_len = sizeof(*cmd) + len;
+
+	cmd->server_if = server_if;
+	cmd->attribute_handle = attribute_handle;
+	cmd->conn_id = conn_id;
+	cmd->len = len;
+	cmd->confirm = confirm;
+
+	memcpy(cmd->value, p_value, len);
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_SERVER_SEND_INDICATION,
+					cmd_len, &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t send_response(int conn_id, int trans_id, int status,
 						btgatt_response_t *response)
 {
-	return BT_STATUS_UNSUPPORTED;
+	char buf[IPC_MTU];
+	struct hal_cmd_gatt_server_send_response *cmd = (void *) buf;
+	size_t cmd_len = sizeof(*cmd) + sizeof(*response);
+
+	cmd->conn_id = conn_id;
+	cmd->trans_id = trans_id;
+	cmd->status = status;
+	cmd->len = sizeof(*response);
+
+	memcpy(cmd->data, response, sizeof(*response));
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_SERVER_SEND_RESPONSE,
+					cmd_len, &cmd, 0, NULL, NULL);
 }
 
 static bt_status_t init(const btgatt_callbacks_t *callbacks)
@@ -1047,6 +1164,7 @@ static btgatt_server_interface_t server_iface = {
 	.register_server = register_server,
 	.unregister_server = unregister_server,
 	.connect = server_connect,
+	.disconnect = server_disconnect,
 	.add_service = add_service,
 	.add_included_service = add_included_service,
 	.add_characteristic = add_characteristic,
-- 
1.9.0


^ permalink raw reply related

* Re: [PATCH BlueZ v0 1/9] gdbus: Add g_dbus_client_set_proxies_ready_watch()
From: Claudio Takahasi @ 2014-03-06 12:24 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ development
In-Reply-To: <F4FB24C3-8BD8-4415-AF9D-E97FEBB06781@holtmann.org>

Hi Marcel,

On Wed, Mar 5, 2014 at 3:37 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Claudio,
>
>> This patch adds a new gdbus helper to notify the clients that
>> GetManagedObjects reply was received and the last proxy has been
>> informed previously by the proxy_added callback.
>> ---
>> gdbus/client.c | 18 ++++++++++++++++++
>> gdbus/gdbus.h  |  4 ++++
>> 2 files changed, 22 insertions(+)
>>
>> diff --git a/gdbus/client.c b/gdbus/client.c
>> index be8cc29..f479742 100644
>> --- a/gdbus/client.c
>> +++ b/gdbus/client.c
>> @@ -56,6 +56,8 @@ struct GDBusClient {
>>       void *signal_data;
>>       GDBusProxyFunction proxy_added;
>>       GDBusProxyFunction proxy_removed;
>> +     GDBusClientReadyFunction ready;
>> +     void *ready_data;
>>       GDBusPropertyFunction property_changed;
>>       void *user_data;
>>       GList *proxy_list;
>> @@ -982,6 +984,9 @@ static void parse_managed_objects(GDBusClient *client, DBusMessage *msg)
>>
>>               dbus_message_iter_next(&dict);
>>       }
>> +
>> +     if (client->ready)
>> +             client->ready(client->ready_data);
>> }
>>
>> static void get_managed_objects_reply(DBusPendingCall *call, void *user_data)
>> @@ -1261,3 +1266,16 @@ gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
>>
>>       return TRUE;
>> }
>> +
>> +gboolean g_dbus_client_set_proxies_ready_watch(GDBusClient *client,
>> +                                             GDBusClientReadyFunction ready,
>> +                                             void *user_data)
>> +{
>> +     if (client == NULL)
>> +             return FALSE;
>> +
>> +     client->ready = ready;
>> +     client->ready_data = user_data;
>> +
>> +     return TRUE;
>> +}
>> diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
>> index 9542109..aa407aa 100644
>> --- a/gdbus/gdbus.h
>> +++ b/gdbus/gdbus.h
>> @@ -337,6 +337,7 @@ gboolean g_dbus_proxy_method_call(GDBusProxy *proxy, const char *method,
>>                               GDBusReturnFunction function, void *user_data,
>>                               GDBusDestroyFunction destroy);
>>
>> +typedef void (* GDBusClientReadyFunction) (void *user_data);
>> typedef void (* GDBusProxyFunction) (GDBusProxy *proxy, void *user_data);
>> typedef void (* GDBusPropertyFunction) (GDBusProxy *proxy, const char *name,
>>                                       DBusMessageIter *iter, void *user_data);
>> @@ -365,6 +366,9 @@ gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
>>                                       GDBusProxyFunction proxy_removed,
>>                                       GDBusPropertyFunction property_changed,
>>                                       void *user_data);
>> +gboolean g_dbus_client_set_proxies_ready_watch(GDBusClient *client,
>> +                                             GDBusClientReadyFunction ready,
>> +                                             void *user_data);
>
> this names is a bit confusing. On one hand it is proxies ready on the other it is client ready. We need to be a bit specific here.
>
> My initial thinking is this should be
>
>         g_dbus_client_set_ready_watch()
>
> and then use GDBusClientFunction(GDBusClient, user_data) as callback function.
>
> Regards
>
> Marcel

Ok. I will send another patchset renaming the function.

For our use case, the GDBus Proxy order is important, for others maybe
it is not relevant. Another possible implementation could be detect if
the reported proxy is the last. ProxyAdded callback could be extended
to report some sort of index x/y or create a new helper
g_dbus_client_get_proxy_last().


Regards,
Claudio

^ permalink raw reply

* [PATCH BlueZ 1/4] android/avrcp: Add remote features notification
From: Luiz Augusto von Dentz @ 2014-03-06 13:03 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 android/avrcp.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/android/avrcp.c b/android/avrcp.c
index cb46dcc..d5eb31d 100644
--- a/android/avrcp.c
+++ b/android/avrcp.c
@@ -43,6 +43,7 @@
 #include "ipc.h"
 #include "bluetooth.h"
 #include "avrcp.h"
+#include "utils.h"
 
 #define L2CAP_PSM_AVCTP 0x17
 
@@ -699,6 +700,7 @@ static const struct avrcp_control_handler control_handlers[] = {
 static int avrcp_device_add_session(struct avrcp_device *dev, int fd,
 						uint16_t imtu, uint16_t omtu)
 {
+	struct hal_ev_avrcp_remote_features ev;
 	char address[18];
 
 	dev->session = avrcp_new(fd, imtu, omtu, dev->version);
@@ -717,6 +719,21 @@ static int avrcp_device_add_session(struct avrcp_device *dev, int fd,
 	/* FIXME: get the real name of the device */
 	avrcp_init_uinput(dev->session, "bluetooth", address);
 
+	bdaddr2android(&dev->dst, ev.bdaddr);
+	ev.features = HAL_AVRCP_FEATURE_NONE;
+
+	DBG("version 0x%02x", dev->version);
+
+	if (dev->version < 0x0103)
+		goto done;
+
+	ev.features |= HAL_AVRCP_FEATURE_METADATA;
+
+done:
+	ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP,
+					HAL_EV_AVRCP_REMOTE_FEATURES,
+					sizeof(ev), &ev);
+
 	return 0;
 }
 
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH BlueZ 2/4] android/client: Add AVRCP remote_features_cb support
From: Luiz Augusto von Dentz @ 2014-03-06 13:03 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394111003-2396-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 android/client/if-rc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 55fdf1d..60c3247 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -46,6 +46,15 @@ SINTMAP(btrc_media_attr_t, -1, "(unknown)")
 	DELEMENT(BTRC_MEDIA_ATTR_PLAYING_TIME),
 ENDMAP
 
+static char last_addr[MAX_ADDR_STR_LEN];
+
+static void remote_features_cb(bt_bdaddr_t *bd_addr,
+					btrc_remote_features_t features)
+{
+	haltest_info("%s: remote_bd_addr=%s features=%u\n", __func__,
+				bt_bdaddr_t2str(bd_addr, last_addr), features);
+}
+
 static void get_play_status_cb(void)
 {
 	haltest_info("%s\n", __func__);
@@ -73,6 +82,7 @@ static void volume_change_cb(uint8_t volume, uint8_t ctype)
 
 static btrc_callbacks_t rc_cbacks = {
 	.size = sizeof(rc_cbacks),
+	.remote_features_cb = remote_features_cb,
 	.get_play_status_cb = get_play_status_cb,
 	.get_element_attr_cb = get_element_attr_cb,
 	.register_notification_cb = register_notification_cb,
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH BlueZ 3/4] android/arvrcp: Fix not parsing SDP record correctly
From: Luiz Augusto von Dentz @ 2014-03-06 13:03 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394111003-2396-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 android/avrcp.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/android/avrcp.c b/android/avrcp.c
index d5eb31d..ce636c0 100644
--- a/android/avrcp.c
+++ b/android/avrcp.c
@@ -25,6 +25,7 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <stdbool.h>
 #include <errno.h>
 #include <glib.h>
@@ -68,7 +69,7 @@ struct avrcp_request {
 struct avrcp_device {
 	bdaddr_t	dst;
 	uint16_t	version;
-	uint16_t	features;
+	int		features;
 	struct avrcp	*session;
 	GIOChannel	*io;
 	GQueue		*queue;
@@ -817,15 +818,19 @@ static void search_cb(sdp_list_t *recs, int err, gpointer data)
 
 	for (list = recs; list; list = list->next) {
 		sdp_record_t *rec = list->data;
-		sdp_data_t *data;
+		sdp_list_t *l;
+		sdp_profile_desc_t *desc;
 
-		data = sdp_data_get(rec, SDP_ATTR_VERSION);
-		if (data)
-			dev->version = data->val.uint16;
+		if (sdp_get_profile_descs(rec, &l) < 0)
+			continue;
 
-		data = sdp_data_get(rec, SDP_ATTR_SUPPORTED_FEATURES);
-		if (data)
-			dev->features = data->val.uint16;
+		desc = l->data;
+		dev->version = desc->version;
+
+		sdp_get_int_attr(rec, SDP_ATTR_SUPPORTED_FEATURES,
+							&dev->features);
+		sdp_list_free(l, free);
+		break;
 	}
 
 	if (dev->io) {
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH BlueZ 4/4] android/avrcp: Fix warnings when freeing avrcp_device struct
From: Luiz Augusto von Dentz @ 2014-03-06 13:03 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394111003-2396-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If the device does not yet have queue due to not have a session it cause
the following warnings when avrcp_device_free is called:
(bluetoothd:1102): GLib-CRITICAL **: g_queue_foreach: assertion 'queue != NULL' failed
(bluetoothd:1102): GLib-CRITICAL **: g_queue_free: assertion 'queue != NULL' failed
---
 android/avrcp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/android/avrcp.c b/android/avrcp.c
index ce636c0..1b99a9c 100644
--- a/android/avrcp.c
+++ b/android/avrcp.c
@@ -442,8 +442,10 @@ static void avrcp_device_free(void *data)
 {
 	struct avrcp_device *dev = data;
 
-	g_queue_foreach(dev->queue, (GFunc) g_free, NULL);
-	g_queue_free(dev->queue);
+	if (dev->queue) {
+		g_queue_foreach(dev->queue, (GFunc) g_free, NULL);
+		g_queue_free(dev->queue);
+	}
 
 	if (dev->session)
 		avrcp_shutdown(dev->session);
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH BlueZ v1 0/9] GATT API: Add Register Services Async
From: Claudio Takahasi @ 2014-03-06 13:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi
In-Reply-To: <CAKT1EBfVP_aYMDFdK+vqBxOKEZh2tdfasKkEks4v5H6h-ZXerw@mail.gmail.com>

This patchset is an extension of "[PATCH BlueZ v7 00/11] GATT API:
External Services". It adds the following features:
  * new gdbus helper to allow notifying the clients when
    GetManagedObjects() reply is received and all proxies reported to
    upper-layer.
  * reply for RegisterService() after validating fetched objects
  * adds the service declaration to the local GATT database

* Changes from v0 to v1:
  - renames g_dbus_client_set_proxies_ready_watch() to
    g_dbus_client_set_ready_watch()

Claudio Takahasi (9):
  gdbus: Add g_dbus_client_set_ready_watch()
  gatt: Add proxy added handler
  gatt: Add proxy removed handler
  gatt: Add GATT service to the local database
  gatt: Make RegisterService() async
  test: Add external service GATT skeleton
  test: Add signal handling for gatt-service
  test: Add registering external service
  bluetooth.conf: Add ObjectManager interface

 .gitignore          |   1 +
 Makefile.tools      |   5 +
 gdbus/client.c      |  17 ++++
 gdbus/gdbus.h       |   4 +-
 src/bluetooth.conf  |   1 +
 src/gatt-dbus.c     | 135 +++++++++++++++++++++++++-
 test/gatt-service.c | 267 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 425 insertions(+), 5 deletions(-)
 create mode 100644 test/gatt-service.c

-- 
1.8.3.1


^ permalink raw reply

* [PATCH BlueZ v1 1/9] gdbus: Add g_dbus_client_set_ready_watch()
From: Claudio Takahasi @ 2014-03-06 13:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi
In-Reply-To: <1394113467-24331-1-git-send-email-claudio.takahasi@openbossa.org>

This patch adds a new gdbus helper to notify the clients that
GetManagedObjects reply was received and the last proxy has been
informed previously by the proxy_added callback.
---
 gdbus/client.c | 17 +++++++++++++++++
 gdbus/gdbus.h  |  4 +++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/gdbus/client.c b/gdbus/client.c
index be8cc29..5193b6c 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -56,6 +56,8 @@ struct GDBusClient {
 	void *signal_data;
 	GDBusProxyFunction proxy_added;
 	GDBusProxyFunction proxy_removed;
+	GDBusClientFunction ready;
+	void *ready_data;
 	GDBusPropertyFunction property_changed;
 	void *user_data;
 	GList *proxy_list;
@@ -982,6 +984,9 @@ static void parse_managed_objects(GDBusClient *client, DBusMessage *msg)
 
 		dbus_message_iter_next(&dict);
 	}
+
+	if (client->ready)
+		client->ready(client, client->ready_data);
 }
 
 static void get_managed_objects_reply(DBusPendingCall *call, void *user_data)
@@ -1243,6 +1248,18 @@ gboolean g_dbus_client_set_signal_watch(GDBusClient *client,
 	return TRUE;
 }
 
+gboolean g_dbus_client_set_ready_watch(GDBusClient *client,
+				GDBusClientFunction ready, void *user_data)
+{
+	if (client == NULL)
+		return FALSE;
+
+	client->ready = ready;
+	client->ready_data = user_data;
+
+	return TRUE;
+}
+
 gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
 					GDBusProxyFunction proxy_added,
 					GDBusProxyFunction proxy_removed,
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 9542109..8ada200 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -337,6 +337,7 @@ gboolean g_dbus_proxy_method_call(GDBusProxy *proxy, const char *method,
 				GDBusReturnFunction function, void *user_data,
 				GDBusDestroyFunction destroy);
 
+typedef void (* GDBusClientFunction) (GDBusClient *client, void *user_data);
 typedef void (* GDBusProxyFunction) (GDBusProxy *proxy, void *user_data);
 typedef void (* GDBusPropertyFunction) (GDBusProxy *proxy, const char *name,
 					DBusMessageIter *iter, void *user_data);
@@ -359,7 +360,8 @@ gboolean g_dbus_client_set_disconnect_watch(GDBusClient *client,
 				GDBusWatchFunction function, void *user_data);
 gboolean g_dbus_client_set_signal_watch(GDBusClient *client,
 				GDBusMessageFunction function, void *user_data);
-
+gboolean g_dbus_client_set_ready_watch(GDBusClient *client,
+				GDBusClientFunction ready, void *user_data);
 gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
 					GDBusProxyFunction proxy_added,
 					GDBusProxyFunction proxy_removed,
-- 
1.8.3.1


^ permalink raw reply related


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