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

nRf52832 device name change by using mobile app

Hi,

I need to change the Device name in nRf52832. Mobile app sends the request to nRf52832. 

Thanks.

static void ChangeDeviceName(void)
{
        uint32_t err_code;
        ble_gap_conn_sec_mode_t sec_mode;
        ble_gap_conn_params_t gap_conn_params;
        BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
        static uint8_t index = 0;

        advertising_stop();

        //sprintf(Devicename3, "HUAWEI_DEVICE %d", index);
        index++;
        err_code = sd_ble_gap_device_name_set(&sec_mode,
                                              (uint8_t *) Devicename3,
                                              strlen(Devicename3));

        NRF_LOG_INFO("device name error %d", err_code);
        APP_ERROR_CHECK(err_code);
}

Parents Reply Children
No Data
Related