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

thierry37_2
Posts: 11
Joined: Tue Jul 23, 2019 12:52 pm

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

Postby thierry37_2 » Mon Apr 17, 2023 2:45 pm

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

phatpaul
Posts: 110
Joined: Fri Aug 24, 2018 1:14 pm

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

Postby phatpaul » 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.

tommeyers
Posts: 184
Joined: Tue Apr 17, 2018 1:51 pm
Location: Santiago, Dominican Republic

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

Postby tommeyers » Thu Apr 20, 2023 9:28 pm

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
IT Professional, Maker
Santiago, Dominican Republic

thierry37_2
Posts: 11
Joined: Tue Jul 23, 2019 12:52 pm

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

Postby thierry37_2 » Mon Apr 24, 2023 1:05 pm

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

Who is online

Users browsing this forum: Majestic-12 [Bot] and 97 guests