Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GATT Notifications #119

Open
2 tasks done
colemancda opened this issue Jan 20, 2019 · 5 comments
Open
2 tasks done

Fix GATT Notifications #119

colemancda opened this issue Jan 20, 2019 · 5 comments
Assignees
Labels

Comments

@colemancda
Copy link
Member

colemancda commented Jan 20, 2019

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.
@colemancda colemancda added the bug label Jan 20, 2019
@colemancda colemancda self-assigned this Jan 20, 2019
@colemancda
Copy link
Member Author

colemancda commented Jan 20, 2019

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)

@colemancda
Copy link
Member Author

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 })

colemancda added a commit that referenced this issue Jan 21, 2019
Only notify connected client if write is from server and not client
write request
colemancda added a commit to PureSwift/GATT that referenced this issue Jan 21, 2019
@colemancda
Copy link
Member Author

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

@sbrewin
Copy link

sbrewin commented Sep 1, 2020

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?

@justinmiller62
Copy link

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.

oleglukasevici added a commit to oleglukasevici/bluetooth-generic-attribute-profile that referenced this issue Feb 15, 2022
oleglukasevici added a commit to oleglukasevici/bluetooth-generic-attribute-profile that referenced this issue Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants