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.

CC2640: How can I enable the characteristic 4 notification in the Simple Peripheral project by default?

Part Number: CC2640

Hello,
can someone suggest me what is the easiest way to set the notification for Characteristic 4 active by default.

I thought one way might be to call the simpleProfile_WriteAttrCB function in the SimplePeripheral_init. But maybe there is a faster method, like changing some parameters in simple_gatt_profile.

Thank you in advance.

  • Hello,

    I have a few questions that may help us in resolving this as efficiently as possible. Can you specify which SDK you are using? To clarify, are you using the CC2640R2 or the CC2640 device? If you are using the CC2640R2 device, then I believe the Custom Profile SLA Lab may provide some useful information. Typically, the central side of the connection is expected to enable the notifications by writing to the appropriate attribute. You may be able to write to the appropriate attribute locally to which may cause the notifications to be sent out. However, if the central side of the connection is not expecting notifications, then they may not behave in the expected manner. I would suggest testing this and taking a BLE sniffer capture to see if you are able to detect the notifications being sent over the air.

    Best Regards,

    Jan

  • Thanks Jan for your reply.
    I am using the CC2640R2. I didn't quite understand what you mean by "the central side of the connection".
    I connect with an Android App with BLE libraries but I would like to avoid having to send the notification activation command for characteristic 4. I would like the notification to be on when the cc2640 starts. Is this possible?
    I have already visited the Custom Profile SLA Lab and it was very helpful but not in solving this problem.
    I noticed that simpleProfileChar4Config is initialized by GATTServApp_InitCharCfg with GATT_CFG_NO_OPERATION; I tried to change the value in GATT_CLIENT_CFG_NOTIFY but the notification continues to be disabled.
    I also tried what is suggested in this post (my problem is identical), but even there the problem was not solved:
    e2e.ti.com/.../cc2640-how-to-set-the-default-value-of-notify-of- a-characteristic-to-yes

  • Hi,

    Thank you for the additional information. Upon doing some additional research, it seems that enabling notifications by default prior to a connection being establish does not technically meet the spec. The following threads contain some information on this as well as a potential method for enabling notifications anyways (this change will technically not meet the spec).

    https://e2e.ti.com/f/1/t/482970

    https://e2e.ti.com/f/1/t/186781/

    Best Regards,

    Jan

  • Thanks again Jan,
    I will try to set the notification to on only at runtime with GATTServApp_WriteCharCfg after the device has made the connection.
    But now I can't figure out where to check if the connection (not bind type) has occurred in simple_peripheral. Any suggestions?

  • Hi,

    No problem! When a connection is established, an event will be generated. If you are using the BLE5 stack of the CC2640R2, then the GAP_LINK_ESTABLISHED_EVENT event will be generated. If you are using the BLE stack of the CC2640R2, then the GAPROLE_CONNECTED event will be generated.

    Best Regards,

    Jan