I have a feeling I am missing something completely obvious here. That said, this problem has cost me enough time today that I'm willing to risk embarrassment to see if someone can point out whatever mistake I am making here. This is on an older product that is running the 6.0.0 S110 soft device. I am calling sd_ble_gatts_value_set() via ble_dis_sw_rev_update() to update the software revision field of the device information service. I have been getting NRF_ERROR_DATA_SIZE returned as a result of this code:
char fw_minor_revision_str[4] = {0};
uint8_t fw_rev_minor;
uint32_t err_code;
ble_srv_utf8_str_t encoded_fw_str;
fw_rev_minor = serial_message.msg.bfr.data[1];
itoa((uint32_t)fw_rev_minor, fw_minor_revision_str);
ble_srv_ascii_to_utf8(&encoded_fw_str, fw_minor_revision_str);
err_code = ble_dis_sw_rev_update(encoded_fw_str.p_str, encoded_fw_str.length);
The ble_dis_sw_rev_update() function looks like:
uint32_t ble_dis_sw_rev_update(uint8_t * sw_rev_string, uint16_t length) {
return sd_ble_gatts_value_set(sw_rev_handles.value_handle, 0, &length, (uint8_t *)sw_rev_string);}
Any thoughts would be appreciated.