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

iOS Shows "nRF5x" as device name even if no device name is advertised

Hello,

I am developing a BLE peripheral with three services:

  • Device Information Service
  • Custom service #1 with two characteristics
  • Custom service #2 with one characteristcs

In advertisement data the advertisement type flags and manufacturer specific data i present, and in the scan response data one of the service UUID. I cannot understand why iOS shows the device name "nRF5x".

This is kind of how the code looks like:

static uint8_t m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;

void start_advertise(void)
{

    uint32_t err_code;
    static uint8_t m_enc_advdata[BLE_GAP_ADV_SET_DATA_SIZE_MAX];
    static uint8_t m_enc_srdata[BLE_GAP_SCAN_BUFFER_MAX];
    ble_uuid128_t base_uuid = MY_SERVICE_UUID128;
    ble_gap_adv_data_t m_adv_data;

    ble_gap_adv_params_t adv_params =
    {
        .properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED,
        .p_peer_addr = 0,
        .filter_policy = BLE_GAP_ADV_FP_ANY,
        .interval = BLE_APP_ADV_INTERVAL,
        .duration = BLE_APP_ADV_TIMEOUT_IN_SECONDS,
        .primary_phy = BLE_GAP_PHY_1MBPS,
        .secondary_phy = BLE_GAP_PHY_1MBPS
    };

    err_code = sd_ble_gap_adv_stop(m_adv_handle);
    APP_ERROR_CHECK(err_code);

    conn_params_init();

    m_enc_advdata[0] = 2;   /* BLE AD Length */
    m_enc_advdata[1] = BLE_GAP_AD_TYPE_FLAGS;
    m_enc_advdata[2] = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;

    m_enc_advdata[3] = 0x0F; /* BLE Ad length */
    m_enc_advdata[4] = BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA; /* Manufacturer specific data */
    m_enc_advdata[5] = 0xXX; /* Company */
    m_enc_advdata[6] = 0xYY; /* Company */

    /*
     * Some specific advertisement data here
     */

    m_enc_advdata[18] = 0xZZ;
    m_adv_data.adv_data.p_data = m_enc_advdata;
    m_adv_data.adv_data.len = 19;

    m_enc_srdata[0] = 17;
    m_enc_srdata[1] = BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE;
    memcpy(&m_enc_srdata[2], &base_uuid, 16);

    m_adv_data.scan_rsp_data.p_data = m_enc_srdata;
    m_adv_data.scan_rsp_data.len = 18;

    err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &adv_params);
    APP_ERROR_CHECK(err_code);

    err_code = sd_ble_gap_adv_start(m_adv_handle, SERIAL_BLE_CONN_CFG_TAG);
    APP_ERROR_CHECK(err_code);

}

Any ideas how to fix this? I rather not advertising what chip is used.

Parents Reply Children
  • Thanks for answer. We have seen this issue even with a new phone and a new nRF chip. How does the GAP device name relate to this? That is not configured, but since no name is advertised i thought it would just appear as "N/A".

  • I do not see how that could happen. But note that "nRF5x" is the default device name of the SoftDevice (BLE_GAP_DEVNAME_DEFAULT), so you may have used that for a device even if you did not know it. And even if you never advertise it, the iPhone wills till show the name if you have connected to the device before, as it would have been read and cached.

    I have no explanation for how you can see this for a device that has never been used though unless you program a specific BLE address which you have also used for another nRF device that was previously used with the same iPhone.

Related