Skip to content

Fix GATT Notifications #119

Open
Open

Description

@colemancda

GATTServer should not be sending GATT notifications to the connected client that wrote the value.

  • If the Peripheral wrote a new value, all connected clients should be notified.
  • If a Central wrote a value, all connected centrals, except the one that wrote the value, should be notified.

Activity

  1. self-assigned this
    on Jan 20, 2019
  2. colemancda commented on Jan 20, 2019

    @colemancda
    MemberAuthor

    Initial work in ab33985 . Need to differentiate between:

    • Write triggered by Peripheral (inform all Centrals)
    • Write triggered by current Central (inform other Centrals)
    • Write triggered by other Central (Inform this Central)
  3. colemancda commented on Jan 21, 2019

    @colemancda
    MemberAuthor

    Notifications for characteristics will not work for multiple characteristics with the same UUID in a service.

    let characteristic = service.characteristics.first(where: { $0.uuid == attribute.uuid })

  4. added 2 commits that reference this issue on Jan 21, 2019
  5. colemancda commented on Jan 21, 2019

    @colemancda
    MemberAuthor

    There seems to also be issues in the GATTClient implementation https://gist.github.com/wlisac/75650c0bc54ffb4a248b8aff306ff715

  6. sbrewin commented on Sep 1, 2020

    @sbrewin

    I can confirm the there is an issue around GATTClient processing notifications. A peripheral receives and processes the subscribe request from the GATTClient and the unsubscribe request when the GATTClient is closed. Notifications sent by the peripheral are not being processed correctly by the GATTClient.
    Before I debug further I thought I’d ask if anyone else is actively working on this and if so what progress has been made?

  7. justinmiller62 commented on Apr 27, 2021

    @justinmiller62

    I am also getting this error
    Assertion failed: Invalid range: file /data/scanner/SwiftScanner/.build/checkouts/Bluetooth/Sources/BluetoothGATT/GATTClient.swift, line 470

    Whenever I start a notify on characteristic. It doesn't happen every time but does once about 1 in 3 times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions