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

Dynamic updating of serial number in device ID

Ole, I am trying to update the serial number value in an already initialized standard Device ID profile. [i]dis_init.serial_num_str.length = (uint16_t)strlen(newserial); dis_init.serial_num_str.p_str = (uint8_t *)newserial; err_code = ble_dis_update(&dis_init);[/i]

and this [i]uint32_t ble_dis_update(const ble_dis_init_t * p_dis_init){ uint32_t err_code;

if (p_dis_init->serial_num_str.length > 0) {
    err_code = char_add(BLE_UUID_SERIAL_NUMBER_STRING_CHAR,
                        p_dis_init->serial_num_str.p_str, 
                        p_dis_init->serial_num_str.length,
                        &p_dis_init->dis_attr_md,
                        &serial_num_handles);
    if (err_code != NRF_SUCCESS) {
        return err_code;
    }
}
return NRF_SUCCESS;

}[/i] And while nothing throws an error, it also doesn't update the value. Any ideas?

Another option I have here is to use a soft reset to start the system over again, and I may have a use for that anyway, so I have search through a the documentation but I cant seem to find a way to force a reset. Is inline with a jump to the reset vector the only way, or is there something a little more elegant?

Parents Reply Children
No Data
Related