Some questions about BLE characteristic's permission

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
stanley_yeh
Offline
Last seen:1 year 9 months ago
Joined:2016-12-23 06:52
Some questions about BLE characteristic's permission

Hi there,

I have some questions about BLE characteristics' permission.
Our customer want one of our device's characteristic supports both notification and indication, so I set it as follow:

[CUSTOMER_IDX_CONTROL_POINT_VAL] = {CUSTOMER_CONTROL_POINT_UUID_128, ATT_UUID_128_LEN, PERM(WR, ENABLE) | PERM(WRITE_REQ, ENABLE) | PERM(IND, ENABLE) | PERM(NTF, ENABLE), DEF_CUST1_INDICATEABLE_CHAR_LEN, 0, NULL},

I just want to know, Is it legal that I set the one characteristic with notification and indication permission? Is it a normal case?

我发现对话框的SDK不起作用与notification and indication.
If I set "PERM(IND, ENABLE) | PERM(NTF, ENABLE)", only notification works. When host sent "02 00" (enable indication), DA14585 will return PRF_ERR_INVALID_PARAM.
Could you please check the code "status = check_client_char_cfg(PERM_IS_SET(perm, NTF, ENABLE), param);" in "\sdk\ble_stack\profiles\custom\custs\src\custs1_task.c"?

Thanks a lot.

Device:
PM_Dialog
Online
Last seen:5 min 56 sec ago
Staff
Joined:2018-02-08 11:03
Hi stanley_yeh,

Hi stanley_yeh,

We don’t support both notification and indication in the same characteristic, because it does not make sense. You will receive only an indication or only a notification. The code that you have posted, checks if the characteristic is indictable OR notifiable.

Thanks, PM_Dialog

stanley_yeh
Offline
Last seen:1 year 9 months ago
Joined:2016-12-23 06:52
Hi PM_Dialog,

Hi PM_Dialog,
I mean the characteristic supports these 2 permissions, indication and notification, but there is only one permission will be enable at one time.
I am not saying that these two permissions are enabled simultaneously.
If host sends 01 00 to the 0x2902 descriptor of our device, our device will notify messages to host,
If host sends 02 00 to the 0x2902 descriptor of our device, our device will indicate messages to host.
Could you please kindly tell me why doesn't it make sense?

Thanks a lot. :)

PM_Dialog
Online
Last seen:5 min 56 sec ago
Staff
Joined:2018-02-08 11:03
Hi stanley_yeh,

Hi stanley_yeh,

Yes, this it is expectable that only one permission will be enable at one time. The characteristic will be only indictable or only notifiable at one time, that’s the reason why we don’t support both notification and indication in the same characteristic.

Thanks, PM_Dialog