Hi,
I am working with a custom board based on nRF52840. I am using SDK 15.0 and softdevice 6.0.0.
I have two custom services that have user descriptions on all characteristics. I have ensured that wr_aux is set to 0 in the extended properties. However nrfConnect is showing an up arrow. I note this devzone post from three years ago: https://devzone.nordicsemi.com/f/nordic-q-a/12185/user-description-read-only. Which didn't come to any conclusion about why it was showing as writable or how to stop it showing as writable.
static uint32_t char_add(uint16_t uuid,
uint8_t * p_char_value,
uint16_t char_len,
ble_srv_security_mode_t const * dis_attr_md,
ble_gatts_char_handles_t * p_handles,
char *p_desc)
{
ble_uuid_t ble_uuid;
ble_gatts_char_md_t char_md;
ble_gatts_attr_t attr_char_value;
ble_gatts_attr_md_t attr_md, desc_md;
APP_ERROR_CHECK_BOOL(p_char_value != NULL);
APP_ERROR_CHECK_BOOL(char_len > 0);
// The ble_gatts_char_md_t structure uses bit fields. So we reset the memory to zero.
memset(&char_md, 0, sizeof(char_md));
memset(&desc_md, 0, sizeof(ble_gatts_attr_md_t));
BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&desc_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&desc_md.write_perm);
desc_md.vloc = BLE_GATTS_VLOC_STACK;
desc_md.vlen = 0;
char_md.p_char_pf = NULL;
char_md.p_user_desc_md = &desc_md;
char_md.p_char_user_desc = p_desc;
char_md.char_user_desc_size = strlen(p_desc);
char_md.char_user_desc_max_size = strlen(p_desc);
// char_md.p_user_desc_md = NULL;
char_md.p_cccd_md = NULL;
char_md.p_sccd_md = NULL;
char_md.char_ext_props.wr_aux = 0;
char_md.char_ext_props.reliable_wr = 0;
char_md.char_props.read = 1;
char_md.char_props.write = 0;
BLE_UUID_BLE_ASSIGN(ble_uuid, uuid);
memset(&attr_md, 0, sizeof(attr_md));
attr_md.read_perm = dis_attr_md->read_perm;
attr_md.write_perm = dis_attr_md->write_perm;
attr_md.vloc = BLE_GATTS_VLOC_STACK;
attr_md.rd_auth = 0;
attr_md.wr_auth = 0;
attr_md.vlen = 0;
memset(&attr_char_value, 0, sizeof(attr_char_value));
attr_char_value.p_uuid = &ble_uuid;
attr_char_value.p_attr_md = &attr_md;
attr_char_value.init_len = char_len;
attr_char_value.init_offs = 0;
attr_char_value.max_len = char_len;
attr_char_value.p_value = p_char_value;
return sd_ble_gatts_characteristic_add(m_dev_service.svc_h, &char_md, &attr_char_value, p_handles);
}
thanks in advance
Paul