All of lore.kernel.org
 help / color / mirror / Atom feed
From: Travis Griggs <travisgriggs@gmail.com>
To: Bluez mailing list <linux-bluetooth@vger.kernel.org>
Subject: StopNotify not firing? (was: Query BLE connected status?)
Date: Mon, 12 Sep 2016 10:49:37 -0700	[thread overview]
Message-ID: <BE6EC190-160F-4895-82D0-B31D7CB3DB18@gmail.com> (raw)
In-Reply-To: <A4055AB1-FBEC-48D9-81BB-54FAFDB73744@gmail.com>


> On Sep 12, 2016, at 8:52 AM, Travis Griggs <travisgriggs@gmail.com> =
wrote:
>=20
> It seems to me though, that maybe I=E2=80=99m going about this wrong. =
I don=E2=80=99t care about the device identity, or which devices are =
connected or not. What I really care about is if any device is connected =
to my app. And maybe I have this (kind of indirectly). My characteristic =
will get a StartNotify/StopNotify event on connect/disconnect edges. I =
can just use those to keep track of when I=E2=80=99m active or not.

So I implemented this, and now notice that while I get the StartNotify =
events, I don=E2=80=99t seem to get the StopNotify events.

In one case, I just shut down my iOS app (which had successfully =
triggered the StartNotify), while the device eventually showed up as =
disconnected, it never propagated a stop notify.

In the next case, I used the LightBlueLE app which allows one to =
explicitly start listen and stop listen. Explicit stop listen commands =
on either didn=E2=80=99t show anything.

Running btmon during a start listen/stop listen cycle produced the =
following output:

# btmon
Bluetooth monitor ver 5.41
=3D New Index: 5C:F3:70:68:C1:F9 (Primary,USB,hci0)               [hci0] =
0.149811
> ACL Data RX: Handle 64 flags 0x02 dlen 9                      [hci0] =
2.681703
      ATT: Write Request (0x12) len 4
        Handle: 0x000d
          Data: 0100
< ACL Data TX: Handle 64 flags 0x00 dlen 5                      [hci0] =
2.693201
      ATT: Write Response (0x13) len 0
> HCI Event: Number of Completed Packets (0x13) plen 5          [hci0] =
3.036696
        Num handles: 1
        Handle: 64
        Count: 1
> ACL Data RX: Handle 64 flags 0x02 dlen 9                     [hci0] =
11.862591
      ATT: Write Request (0x12) len 4
        Handle: 0x000d
          Data: 0000
< ACL Data TX: Handle 64 flags 0x00 dlen 5                     [hci0] =
11.864894
      ATT: Write Response (0x13) len 0
> HCI Event: Number of Completed Packets (0x13) plen 5         [hci0] =
12.161577
        Num handles: 1
        Handle: 64
        Count: 1


(also, having btmon running when connected caused btmon to buffer =
overflow and die)=

  reply	other threads:[~2016-09-12 17:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 18:20 Query BLE connected status? Travis Griggs
2016-09-06 20:53 ` Tobias Svehagen
2016-09-07  0:02   ` Travis Griggs
2016-09-07  7:37     ` Tobias Svehagen
2016-09-07 21:14       ` Travis Griggs
2016-09-07 22:19         ` Barry Byford
2016-09-12 15:52           ` Travis Griggs
2016-09-12 17:49             ` Travis Griggs [this message]
2016-09-13 14:41               ` StopNotify not firing? (was: Query BLE connected status?) Luiz Augusto von Dentz
2016-09-12 19:37             ` Query BLE connected status? Barry Byford
2016-09-07 21:23       ` Barry Byford

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=BE6EC190-160F-4895-82D0-B31D7CB3DB18@gmail.com \
    --to=travisgriggs@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.