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

Throw appropriate exception when performing I/O on unknown characteristic #38

Closed
twyatt opened this issue Dec 19, 2020 · 1 comment · Fixed by #56
Closed

Throw appropriate exception when performing I/O on unknown characteristic #38

twyatt opened this issue Dec 19, 2020 · 1 comment · Fixed by #56
Assignees
Milestone

Comments

@twyatt
Copy link
Member

twyatt commented Dec 19, 2020

Currently, when attempting to write/read a characteristic that was not discovered then it will throw a NoSuchElementException (as thrown by first):

val characteristics = services
.first { it.serviceUuid == characteristic.serviceUuid }
.characteristics
return characteristics
.first { it.characteristicUuid == characteristic.characteristicUuid }
.bluetoothRemoteGATTCharacteristic

Instead, we should throw an exception that clearly indicates what service or characteristic wasn't found.

@twyatt

This comment has been minimized.

@twyatt twyatt self-assigned this Dec 19, 2020
@twyatt twyatt added this to the 0.2.0 milestone Dec 31, 2020
twyatt added a commit that referenced this issue Jan 12, 2021
When a service, characteristic or descriptor cannot be found,
`IOException` is now thrown with a `message` stating the UUID that could
not be found.

On Apple platform, services are now cached on service discovery (which
matches behavior of the other platform targets).

Closes #14
Closes #38
twyatt added a commit that referenced this issue Jan 12, 2021
When a service, characteristic or descriptor cannot be found,
`IOException` is now thrown with a `message` stating the UUID that could
not be found.

On Apple platform, services are now cached on service discovery (which
matches behavior of the other platform targets).

Closes #14
Closes #38
twyatt added a commit that referenced this issue Jan 12, 2021
When a service, characteristic or descriptor cannot be found,
`IOException` is now thrown with a `message` stating the UUID that could
not be found.

On Apple platform, services are now cached on service discovery (which
matches behavior of the other platform targets).

Closes #14
Closes #38
twyatt added a commit that referenced this issue Jan 15, 2021
When a service, characteristic or descriptor cannot be found,
`NoSuchElementException ` is now thrown with a `message` stating the
UUID that could not be found.

On Apple platform, services are now cached on service discovery (which
matches behavior of the other platform targets).

Closes #14
Closes #38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant