Hello! I'm trying to add a Client Characteristic Config Descriptor to a notifing characteristic and I'm currently trying to use the function ATT_SERVER_AddCharacteristicClientConfig. The function returns 0 but when I try to find the created descriptor on android I can't find it.

	U8* instantiatedValueMem = (U8*)malloc (BLE_NUM_MAX_CONNECTION * 2);
	AttInstantiatedAttribute *insAttribute = malloc (sizeof (AttInstantiatedAttribute ));
	insAttribute->instantiatedValues = instantiatedValueMem;
	insAttribute->infotype = 0;
	insAttribute->flags= 0;

    U8* uuidX = malloc(36 + 1);
    strcpy(uuidX, "0783b03e-8535-b5a0-7140-a304d2495cbb");

	insAttribute->data10 = &BleServiceBleNotifyCharProperties.CharacteristicAttribute;
	insAttribute->v.data12 = 777;
	insAttribute->data3= BleServiceBleNotifyCharProperties.Characteristic.data3;
	insAttribute->data5= ATT_PERMISSIONS_ALLACCESS;
	insAttribute->data6= 4;
	insAttribute->data7.uuid128= uuidX;
	insAttribute->data13= 5;

	printf("----%d----\r\n", ATT_SERVER_AddCharacteristicClientConfig(
		 (Att16BitCharacteristicAttribute*) &BleServiceBleNotifyCharProperties.Characteristic,
		 AttServerClientConfigDefaultValue,
		 instantiatedValueMem,
		 0,
		 0,
		 (AttInstantiatedAttribute *)insAttribute)
	);

I followed what was documented in the library for the common fields of the AttInstantiatedAttribute:

	*data8;   // node
	*data9;   // node
	*data10;  //the pointer to the attribute that is the service for this attribute
	*data11;  // The pointer to the value
	 data12;  // The value directly saved
	 data7;   // The uuid for the attribute
	 data6;   // The current length of this attribute
	 data8;   // The max len of a VARIABLE attribute
	 data3;   // flag (value or pointer) (16 or 32 bit) (fixed or variable) (valid o
	 data5;   // attribute permission

I'm not sure what the node variables are for however, so I can't be sure if I'm doing this right. I would appreciate any help. Thanks.

0 (0 Stimmen)
RE: BLE - Adding a CCCD to a characteristic
Antwort
24.04.19 16:39 als Antwort auf João Lago.

Is there any example of this?

I can't find an implementation of ATT_SERVER_AddCharacteristicClientConfig in any example.

0 (0 Stimmen)
RE: BLE - Adding a CCCD to a characteristic
Antwort
26.04.19 04:01 als Antwort auf João Lago.

Hi,

Refer the AN_BLE005 - Using ALPWISE SDK and customer specific services.pdf

where sample code is avilable on page 29 as an annexer and also refer section 4.4 & 4.7

Path:

SDK\xdk110\Libraries\BLEStack\3rd-party\Alpwise\ALPW-BLESDKCM3\BLESW_CoreStack\Documentation\ 

Thanks,

Chandrasekaran

+1 (1 Stimme)