Skip to main content
BSpoe.1
Associate III
Mar 10, 2020 7:43 AM UTC
Question

STM32WB55 Device Name is not changed in GAP/GATT

Hey,

I try to change the device name for my broadcast inside the initialization of the Ble_Hci_Gap_Gatt_Init() funtion. My implementation is the following:

static void Ble_Hci_Gap_Gatt_Init(void){
 
 uint8_t index;
 uint16_t gap_service_handle, gap_dev_name_char_handle, gap_appearance_char_handle;
 const uint8_t *bd_addr;
 uint16_t appearance[1] = { BLE_CFG_GAP_APPEARANCE }; 
 
 /**
 * Initialize HCI layer
 */
 /*HCI Reset to synchronise BLE Stack*/
 hci_reset();
 
 /**
 * Write the BD Address
 */
 
 bd_addr = BleGetBdAddress();
 aci_hal_write_config_data(CONFIG_DATA_PUBADDR_OFFSET, 
 CONFIG_DATA_PUBADDR_LEN, 
 (uint8_t*) bd_addr
 );
 
 /**
 * Set TX Power to 0dBm.
 */
 aci_hal_set_tx_power_level(1, CFG_TX_POWER);
 
 /**
 * Initialize GATT interface
 */
 aci_gatt_init();
 
 /**
 * Initialize GAP interface
 */
 const char *name = "STM32WB";
 aci_gap_init(GAP_PERIPHERAL_ROLE, 
 0, 
 APPBLE_GAP_DEVICE_NAME_LENGTH, 
 &gap_service_handle, 
 &gap_dev_name_char_handle, 
 &gap_appearance_char_handle
 );
 
 if (aci_gatt_update_char_value(gap_service_handle, 
 gap_dev_name_char_handle, 
 0,
 strlen(name), 
 (uint8_t *) name))
	{
	 BLE_DBG_SVCCTL_MSG("Device Name aci_gatt_update_char_value failed.\n");
	}
 
 if(aci_gatt_update_char_value(gap_service_handle,
 gap_appearance_char_handle,
 0,
 2,
 (uint8_t *)&appearance))
 {
 BLE_DBG_SVCCTL_MSG("Appearance aci_gatt_update_char_value failed.\n");
 }
/**
 * Initialize Default PHY
 */
 hci_le_set_default_phy(ALL_PHYS_PREFERENCE,TX_1M,RX_1M);
 
}

With the debugger I can see that every function returns a BLE_SUCCESS, but nothing is changed. My BLE scanner app shows me "P2PSRV1" as the device name.

What can I do to set the correct name?

Thanks a lot,

Ben

This topic has been closed for replies.

4 replies

AClif
Associate III
Apr 7, 2020 11:44 AM UTC

I am having the exact same problem, did you manage to get this working?

KPrzy.1
Associate II
Sep 8, 2021 9:50 AM UTC

did You solved this isse? I noticed that when I am changing example then name change but when build two times application with two times name change the name stay unchanged

tguly.1
Associate II
Mar 10, 2023 12:56 PM UTC

Ran into the same issue. Any comment, solution on this one?

tguly.1
Associate II
Mar 10, 2023 2:33 PM UTC