This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRFConnect iOS and Windows see different modified DEVICE_NAME

Hello,

I have modified my device name (nRF52, BLE) per the function below. When flashed to a board, I then use nRF connect to look for this device.

Using Windows nRFConnect and the nRF52 dongle, the name is "JK_BXY". Using iPhone and nRFConnect, the name is "JUNK_BL". These are scanning the same device at the same time!

I have just started to try and understand how this could be, but it seems that the iOS BLE communication must do something different such that the gap_params_init isn't called or is later overridden. But i cannot find another function that does this (overrides).

The only apparent place sd_ble_gap_device_name_set(...) is called is in this function, which clearly only calls out the modified name.

Does anyone have any suggestions on where to look?

static uint32_t gap_params_init(void)
{
    uint32_t                err_code;
    ble_gap_conn_params_t   gap_conn_params = {0};
    ble_gap_conn_sec_mode_t sec_mode;


    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);

    err_code = gap_address_change();
    VERIFY_SUCCESS(err_code);
		
#if (1)
		/* Change name from JUNK_BL which is the define DEVICE_NAME */
		uint8_t devname[6] = {'J','K','_','B','X','Y'}; 
		
		err_code = sd_ble_gap_device_name_set(&sec_mode,
                                          (const uint8_t *)devname,
                                          7);
#else																			
		err_code = sd_ble_gap_device_name_set(&sec_mode,
                                          (const uint8_t *)DEVICE_NAME,
                                          strlen(DEVICE_NAME));
#endif																					
    VERIFY_SUCCESS(err_code);

    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);
    return err_code;
}
Related