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

Access to low level bluetooth callback in custom operations #165

Closed
uKL opened this issue Apr 6, 2017 · 9 comments
Closed

Access to low level bluetooth callback in custom operations #165

uKL opened this issue Apr 6, 2017 · 9 comments
Assignees
Milestone

Comments

@uKL
Copy link
Collaborator

uKL commented Apr 6, 2017

In order to improve throughput more, I'd like to have more direct access (skipping Rx overhead) to BluetoothGattCallback.

Let's discuss how.

@uKL uKL added the enhancement label Apr 6, 2017
@uKL uKL self-assigned this Apr 6, 2017
@uKL uKL mentioned this issue Apr 6, 2017
@dariuszseweryn
Copy link
Owner

First idea - add a callback listener for every possible callback of BluetoothGattCallback

@uKL
Copy link
Collaborator Author

uKL commented Apr 6, 2017

This was my first idea, with a few assumptions:

  1. Only one callback listener can be plugged in at time
  2. It sticks to a custom operation paradigm
  3. The callback listener is disposed (null) at the end of the custom operation automatically to prevent leaks.

What do you think?

@dariuszseweryn
Copy link
Owner

Why 1. Only one callback listener can be plugged in at time?

@uKL
Copy link
Collaborator Author

uKL commented Apr 6, 2017

To simplify the whole thing and avoid list iteration. In the scope of a single custom operation, I think it will be enough. What's your opinion?

@dariuszseweryn
Copy link
Owner

Ah, one at a time in this meaning. That's reasonable. I first thought of a Callback Listener per callback type (one callback for onCharacteristicWrite() other for onCharacteristicChanged() and so on) and that one could not set both at the same time.

@uKL
Copy link
Collaborator Author

uKL commented Apr 6, 2017

Nope, I'm thinking about some abstract class implementing BluetoothGattCallback providing default, empty methods as templates. The user would be able to implement whichever callback required and only that one.

@dariuszseweryn dariuszseweryn added this to the 1.4.0 milestone Jun 5, 2017
@dariuszseweryn
Copy link
Owner

Is available in 1.4.0-SNAPSHOT

@RobLewis
Copy link

This sounds interesting. Is there any documentation of how it fits into the RxAndroidBle overall scheme? Usage example?

@uKL
Copy link
Collaborator Author

uKL commented Sep 18, 2017

Hey Rob,
all you need can be found in RxBleGattCallback#setNativeCallback Javadoc. The BluetoothGattCallback interface is documented in Android’s documentation.

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

No branches or pull requests

3 participants