This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BLE CC2540 SimpleBLEPeripheral - Default Notifications On

Other Parts Discussed in Thread: CC2650, CC2540

Hello,

Basically what I'am trying to do is to, upon initialization, write a value of 0x01 to the characteristic configuration at handle 0x0034 of the simple keys profile to turn on key press notifications. This will eliminate the need for me to do this in BTool every time i connect the dongle to the key fob. I just want the notifications to be on as soon as I establish a connection. I thought this would be pretty simple, and it probably is but don't fully understand how the handles work. It looks to me that in simplekeys.c, all the handles are initialized to zero? shouldn't they already be initialized with values like 0x0033, 0x0034?

// Characteristic Value- Key Pressed
{
{ ATT_BT_UUID_SIZE, keyPressedUUID },    // keyPressedUUID = 0xFFE1
0,                                                                             // Permissions
0,                                                                             // Handle
&skKeyPressed                                                   // pValue
},

// Characteristic configuration
{
{ ATT_BT_UUID_SIZE, clientCharCfgUUID },       // clientCharCfgUUID = 0x2902
GATT_PERMIT_READ | GATT_PERMIT_WRITE,
0,                              // <- 0x0034???
(uint8 *)skConfig   // <- 0x01???
},

If someone could explain to me how handles are initialized and where and I can change the default characteristic configuration value to 0x01 that would be great.

bStatus_t SK_AddService( uint32 services )
{
uint8 status = SUCCESS;

// Initialize Client Characteristic Configuration attributes
for ( uint8 i = 0; i < GATT_MAX_NUM_CONN; i++ )
{                                                                                                     I tried changing values 
skConfig[i].connHandle = INVALID_CONNHANDLE;         <-here 0x0034
skConfig[i].value = GATT_CFG_NO_OPERATION;             <-and here 0x01

}                                                                                                     doesn't work.