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?

Thanks!

EDIT:

For those reading this in the future, I verified 3 answers for this. 1 is for a service and characteristic. The other 2 are for AT commands to accomplish the same task, 1 with persistent data and the other without.

Parents
  • 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)
    {
        switch(msgid)
        {
            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);
                        break;
    								
                    case SVC1_IDX_DEV_NAME_VAL:
                        user_svc1_dev_name_wr_ind_handler(msgid, msg_param, dest_id, src_id);
                        break;
                        .
                        .
                        .

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


    ble_app_peripheral_dev_name.zip

    Kind Regards,
    OV_Renesas


  • Ah, so there is no existing characteristic to change the name? Just wanted to see if there was a way to do it without code.

  • Hi There,

    Thank you for the reply.
    There is not a dedicated characteristic to change the device name. 
    You will have to create a custom characteristic as shown in the previous answer.

    Kind Regards,
    OV_Renesas

  • I see, thanks! One more quick question on the topic: I noticed there are AT commands to change the name, but they're limited to firmware types. Would you happen to know why it would be limited in such a way?

  • Hi There,

    Thank you for the reply.
    Which AT Commands are you referring to? 
    All the supported AT commands for the DA14531 can be found here: 9. AT Commands — DA145XX Tutorial SDK Getting started (renesas.com)
    I do not think there is any command in order to change the device name. However you can follow the logic shared on my first answer and implement your own custom AT command.

    Kind Regards,
    OV_Renesas

  • Unless I'm misunderstanding, I was assuming AT+ADVDATA changed the advertising name to whatever you entered in hex.

    lpccs-docs.renesas.com/.../atcommands.html

  • Hi There,

    As you can see the AT+ADVDATA and AT+ADVRESP commands are not available for DA14531:


    However, you can define them on the user_at_command.h file and they should work as expected.
    The ADVDATA command updates the advertising data and the ADVRESP command updates the scan response data. 
    In codeless, we have stored the Device Name on the Scan Response Data. So you will have to modify the Scan Response Data accordingly in order to change the name. As you can see on the Codeless User Manual, both these commands will require the advertising to restart in order to take effect. 
    Also, when you are connected, even if you update the Scan Response data with your New device name, the Device Name will remain the default. 
    You will have to create your own custom command to update the device name. You will have to store your device name into the device_info struct.

    Kind Regards,
    OV_Renesas

Reply
  • Hi There,

    As you can see the AT+ADVDATA and AT+ADVRESP commands are not available for DA14531:


    However, you can define them on the user_at_command.h file and they should work as expected.
    The ADVDATA command updates the advertising data and the ADVRESP command updates the scan response data. 
    In codeless, we have stored the Device Name on the Scan Response Data. So you will have to modify the Scan Response Data accordingly in order to change the name. As you can see on the Codeless User Manual, both these commands will require the advertising to restart in order to take effect. 
    Also, when you are connected, even if you update the Scan Response data with your New device name, the Device Name will remain the default. 
    You will have to create your own custom command to update the device name. You will have to store your device name into the device_info struct.

    Kind Regards,
    OV_Renesas

Children
  • Oh! I'm sorry I entirely misread it. I could've sworn it was supported on 14531 on standalone but not data pump or vice versa. This is why I was curious why it was supported on some firmware but not the others. 

    Off to create these custom commands then! Thanks for your help.