Hi there,
I have the following settings:
- nrf52810 on a custom board
- only the mandatory GAP service and one custom service with three characteristics, everything is working perfectly so far.
- we are developing our own iOS app for controlling the embedded device.
- the BLE devices and iOS are bonding with a six digit passphase, nothing special and everything is working good.
But:
I can't change the device name from within the iOS bluetooth system dialog. When the app is running, the device is connected, I can see the bonded device name in the list of known devices and when I tap the information button the only thing iOS is offering is to ignore the device / delete the bonding information.
I googled a whole day and I found the following information:
1. iOS uses the advertised local device name in the first place,
2. secondly, when the bonding was sucessfull iOS reads out the mandatory GAP Device Name Characteristic and uses the value as the new Device Name.
3. according to Apple's guidelines this characteristic should be writeable
4. I can't use any of the BLE scanner apps on iOS to actually see if this characteristic is writeable or not so I tried a Window based Scanner (Bluetooth LE Explorer) which shows the GAP Service service and the included characteristics. There you can see that the Device Name Characteristic is read-only.
SDK-Version: 17.0.0
SoftDevice: S112
Question:
1. Assumed, that everything is setup correctly according to Apple's guidelines: is it fundametally possible to use the iOS system dialog to change a BLE Device's name? Or is this only working for other Bluetooth-Protocol-Based devices?
2. If 1. applies, which steps do I have to follow to make the Softdevice's Device Name Characteristic writeable? I tried the following and according to the Windows Scanner it doesn't have an effect:
/* GAP initialisieren */ void gap_params_init(void) { ret_code_t err_code; ble_gap_conn_sec_mode_t sec_mode; BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode); err_code = sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *)DEVICE_NAME, strlen(DEVICE_NAME)); APP_ERROR_CHECK(err_code); ble_gap_conn_params_t gap_conn_params; memset(&gap_conn_params, 0, sizeof(gap_conn_params)); gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL; gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL; gap_conn_params.slave_latency = SLAVE_LATENCY; gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT; err_code = sd_ble_gap_ppcp_set(&gap_conn_params); APP_ERROR_CHECK(err_code); }
According to a few other threads in this forum, on Stackoverflow and the descriptions within the SDK BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode); should do exactly this, make the Device Name Char. writeable.
Why isn't this working?
BTW: the first thing is to make it writeable - storing and restoring it from flash is not part of this discussion, I'm pretty sure that this will be straight forward.
Is there any known side-effect that I have to keep in mind or does this only work together with other (mandatory?) characteristics I have to supply?
I know that I could simple tinker my own custom characteristic to solve the problem but I really like it when things are done properly and when the end customer can just use iOS to change the device name, as he can do with his soundbar, stereo and headset as well.
Help is greatly appreciated because I lost a whole day without getting it to work properly.
Thanks and bye-bye!