Skip to content

GATT server doc improvement #155

@stefan-sedlak

Description

@stefan-sedlak

Hi @philips77
could you please provide an example how to integrate GATT server with multiple connected clients / BleManager-s? I have a use case where I need to notify different characteristic values to different clients.

From README file it is not clear. I miss link between connected client's BluetoothDevice
and its BleManager. Or how to initialize BleManager for connected client.

I used in onDeviceConnectedToServer(@NonNull BluetoothDevice device):

final MyBleManager manager = new MyBleManager(context);
manager.setManagerCallbacks(this);
manager.useServer(serverManager);

and tried to add:

manager.connect(device).enqueue();

It is only method were I can set BluetoothDevice.

But it causes:

E/BleManager: onConnectionUpdated received status: 42, interval: 12, latency: 0, timeout: 200

42 is "Answer to the Ultimate Question of Life, the Universe, and Everything" however in our case status 42 means BLE_HCI_DIFFERENT_TRANSACTION_COLLISION what does not look well.

However it seems that MyBleManager's BleManagerGattCallback triggers onServerReady(@NonNull BluetoothGattServer server) with local GATT server service and characteristics. What I would expect.

So I am confused :)

Thanks for your advise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions