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
ESP Module device name does not change for iOS
-
- Posts: 7
- Joined: Mon Apr 24, 2023 4:36 pm
ESP Module device name does not change for iOS
- Attachments
-
- Skype_Picture_2023_04_26T19_49_25_056Z.jpeg (224 KiB) Viewed 2612 times
-
- Posts: 1707
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: ESP Module device name does not change for iOS
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.
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.
-
- Posts: 7
- Joined: Mon Apr 24, 2023 4:36 pm
Re: ESP Module device name does not change for iOS
Hello,MicroController wrote: ↑Thu Apr 27, 2023 5:59 pmMight 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.
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?
-
- Posts: 1707
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: ESP Module device name does not change for iOS
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.sameer_kelaskar wrote: ↑Fri Apr 28, 2023 12:56 pmHello,
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?
Code: Select all
#include "services/gatt/ble_svc_gatt.h"
ble_svc_gatt_changed(0,0xffff);
-
- Posts: 7
- Joined: Mon Apr 24, 2023 4:36 pm
Re: ESP Module device name does not change for iOS
MicroController wrote: ↑Sat Apr 29, 2023 6:33 pmYou 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.sameer_kelaskar wrote: ↑Fri Apr 28, 2023 12:56 pmHello,
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?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.
- Attachments
-
- usage of ble_svc_gap_device_name_set()
- servicechange_api#03_1.png (271.41 KiB) Viewed 2265 times
-
- usage of ble_svc_gap_device_name_set()
- servicechange_api#02_1.png (241.78 KiB) Viewed 2265 times
-
- Posts: 7
- Joined: Mon Apr 24, 2023 4:36 pm
Re: ESP Module device name does not change for iOS
sameer_kelaskar wrote: ↑Wed May 10, 2023 4:53 amMicroController wrote: ↑Sat Apr 29, 2023 6:33 pmYou 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.sameer_kelaskar wrote: ↑Fri Apr 28, 2023 12:56 pmHello,
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?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.
- Attachments
-
- light blue app result
- app_2.jpg (158.15 KiB) Viewed 2263 times
Who is online
Users browsing this forum: atesin, Bing [Bot] and 133 guests