Page 1 of 1

ESP Module device name does not change for iOS

Posted: Wed Apr 26, 2023 7:52 pm
by sameer_kelaskar
Hello,

I have implemented a BLE GATT server in ESP-IDF v4.3.1 on ESP32-WROOM ESP32-DEVKITC and to connect I am using the LightBlue app. In the app when I connect to the esp module, the ESP module device name which I select remains constant; while the 'local name' in the advertised data changes as I do.
This only happens in case of iOS. While I use the same code for android light ble app ESP module device name which I select and the advertised local name both change together.
All kind help is appreciated.

Many thanks,
Sameer

Re: ESP Module device name does not change for iOS

Posted: Thu Apr 27, 2023 5:59 pm
by MicroController
Might be a caching/bonding issue. You may be able to "refresh" the cached connection data in the app if it has such a function.
A "cleaner" solution may be issuing a "service changed" notification to let interested/bonded clients know that they'd have to re-discover services and attributes, including the "Device Name" characteristic (0x2A00) if present. Although the device name may also be stored/cached with the bonding data and not affected at all by any subsequent name changes from the peripheral after bonding is completed.

Re: ESP Module device name does not change for iOS

Posted: Fri Apr 28, 2023 12:56 pm
by sameer_kelaskar
MicroController wrote:
Thu Apr 27, 2023 5:59 pm
Might be a caching/bonding issue. You may be able to "refresh" the cached connection data in the app if it has such a function.
A "cleaner" solution may be issuing a "service changed" notification to let interested/bonded clients know that they'd have to re-discover services and attributes, including the "Device Name" characteristic (0x2A00) if present. Although the device name may also be stored/cached with the bonding data and not affected at all by any subsequent name changes from the peripheral after bonding is completed.
Hello,
Can I please know that if whether the "service changed notification" be used with NIMBle, and you have mentioned "Device Name" characteristic (0x2A00) so that should be UUID what function apis can be used to access these two parameters. Also can the notification function be called explicitly?

Re: ESP Module device name does not change for iOS

Posted: Sat Apr 29, 2023 6:33 pm
by MicroController
sameer_kelaskar wrote:
Fri Apr 28, 2023 12:56 pm
Hello,
Can I please know that if whether the "service changed notification" be used with NIMBle, and you have mentioned "Device Name" characteristic (0x2A00) so that should be UUID what function apis can be used to access these two parameters.
You can set the 0x2A00 characteristic's value via ble_svc_gap_device_name_set(...). This is separate from the device name included in advertisements, but should be set to the same value, or, if using a shortened name in advertisements, the advertised value should be a prefix of that exact name.
Also can the notification function be called explicitly?

Code: Select all

#include "services/gatt/ble_svc_gatt.h"

ble_svc_gatt_changed(0,0xffff);

Re: ESP Module device name does not change for iOS

Posted: Wed May 10, 2023 4:53 am
by sameer_kelaskar
MicroController wrote:
Sat Apr 29, 2023 6:33 pm
sameer_kelaskar wrote:
Fri Apr 28, 2023 12:56 pm
Hello,
Can I please know that if whether the "service changed notification" be used with NIMBle, and you have mentioned "Device Name" characteristic (0x2A00) so that should be UUID what function apis can be used to access these two parameters.
You can set the 0x2A00 characteristic's value via ble_svc_gap_device_name_set(...). This is separate from the device name included in advertisements, but should be set to the same value, or, if using a shortened name in advertisements, the advertised value should be a prefix of that exact name.
Also can the notification function be called explicitly?

Code: Select all

#include "services/gatt/ble_svc_gatt.h"

ble_svc_gatt_changed(0,0xffff);

Hi,
I have tried using ble_svc_gap_device_name_set() function, to change characteristic's value and the ble_svc_gatt_changed() function to notify but so far I did not get any notification indicating that the service change, please let me know where can I verify the result on both client and server side.
All kind help is appreciated.

Re: ESP Module device name does not change for iOS

Posted: Wed May 10, 2023 4:55 am
by sameer_kelaskar
sameer_kelaskar wrote:
Wed May 10, 2023 4:53 am
MicroController wrote:
Sat Apr 29, 2023 6:33 pm
sameer_kelaskar wrote:
Fri Apr 28, 2023 12:56 pm
Hello,
Can I please know that if whether the "service changed notification" be used with NIMBle, and you have mentioned "Device Name" characteristic (0x2A00) so that should be UUID what function apis can be used to access these two parameters.
You can set the 0x2A00 characteristic's value via ble_svc_gap_device_name_set(...). This is separate from the device name included in advertisements, but should be set to the same value, or, if using a shortened name in advertisements, the advertised value should be a prefix of that exact name.
Also can the notification function be called explicitly?

Code: Select all

#include "services/gatt/ble_svc_gatt.h"

ble_svc_gatt_changed(0,0xffff);

Hi,
I have tried using ble_svc_gap_device_name_set() function, to change characteristic's value and the ble_svc_gatt_changed() function to notify but so far I did not get any notification indicating that the service change, please let me know where can I verify the result on both client and server side.
All kind help is appreciated.