Page 1 of 1

How a gatt server can get th name of a connected gatt client

Posted: Mon Apr 17, 2023 2:45 pm
by thierry37_2
Hello,

I have implemented a gatt server in esp-idf V4.3.3 on WROOM module. This server is emulating a BLE SPP server as per esp-idf gatt server example so that smartphones (with the right software) can connect to it. I have implemented pairing + bonding between the module and the smartphone.

Everything is working fine.

Now, I would like to be able to retrieve the name of the client (smartphone) which is connected to my gatt server. So far, I only have its mac address.

I could not find an easy way to get this name.

Could you please help me ?

Many thanks
Thierry

Re: How a gatt server can get th name of a connected gatt client

Posted: Thu Apr 20, 2023 6:42 pm
by phatpaul
I went through this same issue previously. I wanted to show a "Bonded Devices" list on my ESP32 product with the names of i.e. cellphones that had paired to it.

I didn't find a standard way to do that. I think it is up to you to add a method at the application level to send a name to the GATT server (peripheral). I.e. add a characteristic that your mobile app can write a string to.

Re: How a gatt server can get th name of a connected gatt client

Posted: Thu Apr 20, 2023 9:28 pm
by tommeyers
Your question made me curious so read a little on gatt connections. It appears like the g... Att... Structure is designed to support what you describe. Here is what I read: https://docs.silabs.com/bluetooth/5.0/g ... ient-roles

Tom

Re: How a gatt server can get th name of a connected gatt client

Posted: Mon Apr 24, 2023 1:05 pm
by thierry37_2
phatpaul wrote:
Thu Apr 20, 2023 6:42 pm
I went through this same issue previously. I wanted to show a "Bonded Devices" list on my ESP32 product with the names of i.e. cellphones that had paired to it.

I didn't find a standard way to do that. I think it is up to you to add a method at the application level to send a name to the GATT server (peripheral). I.e. add a characteristic that your mobile app can write a string to.
Thanks Phapaul - I was thinking that there would be some "nominal way" to do this ... But your suggestion makes a lot a sense :) I will implement it.
Best Regards