RxAndroidBle icon indicating copy to clipboard operation
RxAndroidBle copied to clipboard

Are there plans to support Rx-BluetoothGattServer?

Open brightredchilli opened this issue 7 years ago • 9 comments

Hi, I'm working on a project that starts a ble server. As far as I can tell, this library does not wrap BluetoothGattServer. Are there plans for this, and if so, would it be interesting for me to try to get a PR in of something that I have in place? I based my work heavily on how this library is structured.

This is how I imagine the interface would look like:

public interface RxBleServer {

    /***
     * Returns all writes that happen on a particular characteristic UUID. No validation
     * if you subscribe on a characteristic that is not actually a write characteristic.
     * Assembles values if they are written in chunks.
     */
    public Observable<byte[]> getCharacteristicWrites(UUID characteristicUUID);

    /***
     * Send an indication on a characteristic.
     */
    public Observable<Integer> indicateCharacteristic(BluetoothGattCharacteristic characteristic,
                                                      byte[] value);
}

brightredchilli avatar Mar 28 '17 20:03 brightredchilli

Hello @brightredchilli Thanks for your interest. I would definitely like a functionality like this wrapped in an reactive approach. This idea would need a separate module in my opinion (i.e. rxandroidbleserver) as most apps would need either central or peripheral functionality but rather not both. It is interesting tough how Android would handle both roles at once — but that is a different topic. Either way - a green light from me.

dariuszseweryn avatar Mar 29 '17 19:03 dariuszseweryn

Alright, that sounds great - i imagine we'd need to maintain a separate dev branch while the server side stuff gets up to speed - its probably not going to have all of the layers and bells and whistles that the client side has for a bit. I'll start off with 'getWriteCharacteristic'(get all ble writes to a characteristic on this gatt server), in my opinion this has the least dependencies and is the easiest to understand.

brightredchilli avatar Mar 30 '17 12:03 brightredchilli

A good idea from @uKL: prepare the server module so it could be easily plugged in instead of an RxBleDeviceMock. To do that there will be a need for an Interface for all Android components used in the server.

dariuszseweryn avatar Mar 31 '17 09:03 dariuszseweryn

Is there any ongoing work for this. Would love to collaborate?

dustedrob avatar May 08 '17 21:05 dustedrob

Hi @dariuszseweryn

is there any plan to release RxAndroidBle version with server support? If yes, then when it is expected to arrive?

kobronson avatar Jun 28 '17 11:06 kobronson

Hello @kobronson

We have a plan (as you see this issue being opened) but it is not decided yet in what version of the library (or a different project) it will be available nor when will it arrive. There are things that have greater priority at the moment.

External pull requests are welcomed though. :)

dariuszseweryn avatar Jun 28 '17 11:06 dariuszseweryn

Just to mention that the API may be shared with the mock #370

uKL avatar Mar 16 '18 13:03 uKL

@DariuszAniszewski I could really use this, how much work would a simple implementation take? Maybe I can fund a Bounty on it.

EskelCz avatar Oct 16 '18 15:10 EskelCz

Thank you for the proposal.

From my experience there is not much trouble using the vanilla Android API for the BLE Server.

The general idea for the server functionality was about enabling an easy mocking experience for test purposes of this library. Unfortunately we are short on time/people to maintain the mockclient so we have not invested time into the topic — there are other things with greater priority at this moment.

dariuszseweryn avatar Oct 23 '18 13:10 dariuszseweryn