public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Eggers <ceggers@arri.de>
To: <linux-bluetooth@vger.kernel.org>, <frederic.danis@collabora.com>
Subject: Running GATT/SR/GAI/BV-01-C and GATT/SR/GAI/BV-02-C tests
Date: Wed, 11 Feb 2026 14:17:42 +0100	[thread overview]
Message-ID: <5832992.IbC2pHGDlb@n9w6sw14> (raw)

According to Frédéric's instruction [1], GATT/SR/GAI/BV-01-C should executed
with a custom service/characteristic added via bluetootctl:

+------------------------+----------+---------+-------+-------------------------------------------------------------------------+
| GATT/SR/GAI/BV-01-C    | PASS     |     6.1 | 5.69  | Run 'bluetoothctl':                                                     |
|                        |          |         |       |                                                                         |
|                        |          |         |       | - [bluetooth]# gatt.register-service 0xFFFF                             |
|                        |          |         |       |                                                                         |
|                        |          |         |       |   - *yes* when asked if primary service                                 |
|                        |          |         |       |                                                                         |
|                        |          |         |       | - [bluetooth]# gatt.register-characteristic 0xAAAA read,write           |
|                        |          |         |       |                                                                         |
|                        |          |         |       |   - enter '1' when prompted                                             |
|                        |          |         |       |                                                                         |
|                        |          |         |       | - [bluetooth]# gatt.register-application                                |
+------------------------+----------+---------+-------+-------------------------------------------------------------------------+

With the current PTS, the test is being stuck waiting for on indication on the
characteristic with the handle 0x0008:

> Please send an Handle Value indication handle = '0008'O after enabled by the
> PTS.
> 
> Description: Verify that the Implementation Under Test (IUT) can send handle
> value notification to the PTS.

According to btmon, this is the "Service Changed" characteristic,
which is automatically created by bluetoothd in populate_gatt_service().

bluetoothd[511]: < ACL Data TX: Handle 24 flags 0x00 dlen 27                                                                          #36 [hci0] 1187.212787
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
...
        Handle: 0x0007
        Value[5]:
        20 08 00 05 2a                                    ...*           
            Properties: 0x20
              Indicate (0x20)
            Value Handle: 0x0008
            Value UUID: Service Changed (0x2a05)

It looks like the testcase doesn't use the characteristic (0xAAAA) set up via
bluetoothctl at all. Instead it seems to pick up the first characteristic
returned by READ_BY_TYPE which has the 'Indicate' (0x20) property.

After comparing with the instructions for other tests, it looks like I need
to use 'btgatt-server' for manually sending the notification.

Q1: How does btgatt-server interfere with bluetoothd? I guess that both are
    listening on the same CID? It looks like btgatt-server has precedence in
    accepting new connections, but how does this work?

Instead of following the bluetootctl based setup, I then ran btgatt-server and
sent the notification manually. But there is another check in the testcase
which disconnects/reconnects the ACL and verifies that the client configuration
descriptor has been reset to 0 (GATT/SR/GAI/BV-01-C, no bonding) or been kept
at 2 (GATT/SR/GAI/BV-02-C, with bonding):

> 4.8.2 Characteristic Value Indication - by Server
> • Test Purpose
> Verify that a Generic Attribute Profile server can send a Characteristic
> Value Indication and that it retains or resets the configured CCCD after
> disconnection and reconnection depending on bonding.

After reconnection, GATT/SR/GAI/BV-01-C fails because btgatt-server has
exited on disconnect and the consecutive READ_REQUEST is processed by
bluetoothd (instead of btgatt-server), where the CCCD handle (cached by PTS)
points to another characteristic (which of course doesn't contain the
expected value).

Immediately restarting btgatt-server can fix this, but it feels like this
defends the purpose of this unit test.

Q2: Are there plans to implement "manual sending of notifications by handle"
    in bluetoothd/bluetootctl?

In order to process with GATT/SR/GAI/BV-02-C, I modified btgatt-server in a
way that it accepts further ATT connections after disconnect instead of
exiting. Although the PTS test is happy (due to the retained value of the
CCCD's value), it feels wrong to me to reimplement the lifecycle of the CCCD's
value within btgatt-server instead of testing with the "real" implementation.

Any idea how can "improve" execution of this tests?

regards,
Christian

[1] https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/qualification/gatt-pts.rst#n1106



             reply	other threads:[~2026-02-11 13:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 13:17 Christian Eggers [this message]
2026-02-11 18:30 ` Running GATT/SR/GAI/BV-01-C and GATT/SR/GAI/BV-02-C tests Luiz Augusto von Dentz
2026-02-24 19:21   ` Christian Eggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5832992.IbC2pHGDlb@n9w6sw14 \
    --to=ceggers@arri.de \
    --cc=frederic.danis@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox