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!
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, ¶m->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); }
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; . . .
Quick follow up to this actually: what compiler is required for these changes?
Hi There,Thank you for the reply.If you are working on Codeless v6.380.16.55 you will need ARM Compiler v6.If you are working on Codeless v6.380.14.22 or any older version you will need ARM Compiler v5.Kind Regards,OV_Renesas