DA14531 Name Change Service/Characteristic

I was curious if there's a characteristic to change the GAP device name.

I know there's one to see the name, but I didn't see one to change the name. Is this one I'd have to manually create or is there a simple way to do so?


  • Hi There,

    Thank you for posting your question online.
    Yes, it is possible to change the Device Name. 
    I worked on the ble_app_peripheral example with SDK v6.0.18.
    I created a custom characteristic for the Custom Service 1.
    On user_custs1_impl.c file:

    void user_svc1_dev_name_wr_ind_handler (ke_msg_id_t const msgid,
                                          struct custs1_val_write_ind const *param,
                                          ke_task_id_t const dest_id,
                                          ke_task_id_t const src_id)
    	char new_device_name[NEW_DEVICE_NAME_LENGTH] = "\0";
    	memcpy(&new_device_name, &param->value, param->length);
    	device_info.dev_name.length = (strlen(new_device_name) <= GAP_MAX_NAME_SIZE) ?strlen(new_device_name) : GAP_MAX_NAME_SIZE;
    	memcpy(device_info.dev_name.name, new_device_name, device_info.dev_name.length);

    On user_peripheral.c file:
    void user_catch_rest_hndl(ke_msg_id_t const msgid,
                              void const *param,
                              ke_task_id_t const dest_id,
                              ke_task_id_t const src_id)
            case CUSTS1_VAL_WRITE_IND:
                struct custs1_val_write_ind const *msg_param = (struct custs1_val_write_ind const *)(param);
                switch (msg_param->handle)
                    case SVC1_IDX_CONTROL_POINT_VAL:
                        user_svc1_ctrl_wr_ind_handler(msgid, msg_param, dest_id, src_id);
                    case SVC1_IDX_DEV_NAME_VAL:
                        user_svc1_dev_name_wr_ind_handler(msgid, msg_param, dest_id, src_id);

    With the SmartBond App I connect into my device and I can change the Device name like this:


    Kind Regards,

  • Quick follow up to this actually: what compiler is required for these changes?

Reply Children