ARMmbed / mbed-os-example-ble

BLE demos using mbed OS and mbed cli
Apache License 2.0
134 stars 117 forks source link

Definition of 'GattServer' device to search for #392

Open kr0sh1 opened 2 years ago

kr0sh1 commented 2 years ago

In the docu of the 'BLE_GattClient_CharacteristicUpdates' example it mentions that it's hardcoded (presumably) to search for a device called 'GattServer'.

Where is this defined and how can it be changed?

noonfom commented 2 years ago

Hi @kr0sh1, that appears to be hardcoded inside the get_peer_device_name() function of the GattClientProcess class.

Editing it seems nontrivial. @paul-szczepanek-arm could this be a private member with a public setter?

kr0sh1 commented 2 years ago

@noonfom perfect, thanks for that!

paul-szczepanek-arm commented 2 years ago

If you just want to change it in the example you can just edit the string here https://github.com/ARMmbed/mbed-os-ble-utils/blob/0da6cf31bd6688e4a3ecdf98b356e4767f3248c4/gatt_client_process.h#L46 to change what device name it's looking for.