Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello, 

   

in BLE component is Custom characteristics "MESSAGE" and in Properties are two parameters: Read and Write

   

These parameters I can change by "tick" button in configure window. It's clear. 

   

But how I can enable/disable for example Write parameter directly in C file? 

   

I would like to have something as: 

   

if ( i == 1) "Write is enable"

   

else "Write is disable"

   

 

   

Thanks in advance, Libor

0 Likes
1 Solution
Anonymous
Not applicable

Nope. That's the constant declared for Cypress' API usage. What you are looking for is more like this:

   

extern CYBLE_GATTC_WRITE_REQ_T serviceChangedCccdPacket;

   

serviceChangedCccdPacket.value = cccdIndFlagSetStruct;
serviceChangedCccdPacket.attrHandle = cyBle_gattc.cccdHandle;
CyBle_GattcWriteCharacteristicDescriptors(cyBle_connHandle, &serviceChangedCccdPacket);
 

   

Note: The example updates the descriptor value within the BLE callback stack, and thus it might have some call requirements to work properly.

   

I got this from the ANCS Example project on github: https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Day022_App...

View solution in original post

0 Likes
5 Replies