This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cccd_handle is difference between getting and setting while notify/indicate

hello all:

I'm using nRF52820, SDK 17.1.0, S113.

I made a BLE perpheral role, and it has two service, each service has two characteristic. like this:

static void set_service(void)
{
    add_base_uuid();

    add_service(&mp_handle->p2c.service, BLE_GATTS_SRVC_TYPE_PRIMARY, PER2CEN_SER_UUID);
    add_char_notify(mp_handle->p2c.service, &mp_handle->p2c.notify);
#ifdef NOTIFY_HAS_DESC_ENABLE
    add_notify_desc(mp_handle->p2c.notify.value_handle, &mp_handle->p2c.notify_desc);
#endif
    add_char_indicate(mp_handle->p2c.service, &mp_handle->p2c.indicate);
#ifdef INDICATE_HAS_DESC_ENABLE
    add_indicate_desc(mp_handle->p2c.indicate.value_handle, &mp_handle->p2c.indicate_desc);
#endif
    add_service(&mp_handle->c2p.service, BLE_GATTS_SRVC_TYPE_PRIMARY, CEN2PER_SER_UUID);
    add_char_rw(mp_handle->c2p.service, &mp_handle->c2p.r_w);
    add_char_rw_no(mp_handle->c2p.service, &mp_handle->c2p.r_wno);
}

When using nRF connect for mobile, i connect this BLE perpheral role. After clicking notify enable icon, i get `BLE_GATTS_EVT_WRITE` event by ble_observer handler and print some log like this:

[00:14:31.432,373] <info> logic: p_ble_evt->header.evt_id :BLE_GATTS_EVT_WRITE.

[00:14:31.432,739] <debug> logic: handle: 14.

[00:14:31.432,861] <debug> logic: uuid: 0x2902.

[00:14:31.433,044] <debug> logic: type: 1.

[00:14:31.433,227] <debug> logic: op: 1.

[00:14:31.433,349] <debug> logic: auth_required: 0.

[00:14:31.433,532] <debug> logic: offset: 0.

[00:14:31.433,654] <debug> logic: len: 2.

[00:14:31.433,837] <debug> logic:  01 00                  |..      

[00:14:31.434,082] <debug> logic: p2c ser handle: 11.

[00:14:31.435,241] <debug> logic: p2c notify value_handle: 13.

[00:14:31.435,363] <debug> logic: p2c notify user_desc_handle: 13.

[00:14:31.435,546] <debug> logic: p2c notify cccd_handle: 13.

[00:14:31.435,729] <debug> logic: p2c notify sccd_handle: 13.

[00:14:31.436,950] <debug> logic: p2c indicate_handle value_handle: 16.

[00:14:31.437,133] <debug> logic: p2c indicate_handle user_desc_handle: 16.

[00:14:31.438,293] <debug> logic: p2c indicate cccd: 16.

[00:14:31.438,476] <debug> logic: p2c indicate sccd: 16.

Q: Setting: `p2c notify cccd_handle: 13`, But Getting cccd_handle is: `handle: 14`.

Related