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.

CC2340R5-Q1: Updating Notification Data

Part Number: CC2340R5-Q1

Hello TI team,

We are using SDK 9.14.

What we want to do is, once per connection interval, update the Notification data using GATTServApp_ProcessCharCfg().

More specifically, before setting, we want to check whether Notification is already configured and then set or update it accordingly. If there is a recommended method to achieve this, please let us know.

Currently, when we call GATTServApp_ProcessCharCfg() twice, two Notifications are sent on the next connection event. We would like only a single Notification to be sent carrying the final configured data.

Thank you for your assistance.

  • HI Hiroki-san,

    Sincerely apologize for the late notice here. We had an issue on our end that led to missing some new threads. Is this question still open? If so, I'll make sure this is assigned immediately. 

  • Hello Evan,

    Thank you for your reply. The issue has not been resolved yet, so I would appreciate it if you could proceed with the assignment.

    Thank you.

  • Hi Hiroki-san,

    For sending notification, the GATTServApp_ProcessCharCfg is the right function as we stand in our example project. The working flow is explained in UG:

    Generic Attribute Profile (GATT) — SimpleLinkTm Low Power F3 SDK BLE5-Stack User's Guide 9.14.01 documentation

    The function feedback status success means the sending requirement is successfully queued to BLE stack, it will process it. But the stack will not compare the previous notification data to the current one. Application layer need to handle the data change. 

    Best Regards,

    Barbara

  • Hi Barbara,

    Thank you for your reply.

    We also agree that using GATTServApp_ProcessCharCfg is the correct approach.

    Could you please explain how the application layer should handle the data change, as you mentioned "Application layer need to handle the data change"? 

    Thank you for your help.

  • Hi Hiroki-san,

    My idea is application layer holds the previous data which was sent successfully, and monitor the feedback value of GATTServApp_ProcessCharCfg when sending new data. If the feedback is success, then update the pervious data with the just sent one. So when application layer want to send the "new data" it can compare the "old data" with current one and see if it is the same or not. 

    Best Regards,

    Barbara

  • Hi Barbara,

    Thank you very much for your reply.

    Would it be possible to provide more specific guidance—for example, with code snippets?

    As our intended behavior may not have been fully conveyed, we have illustrated the desired operation in the diagram below.

    Thank you in advance for your assistance.

  • Hi hrkunied,

    Seems here, keep sending 0x00, 0x01, 0x02, 0x03 in sequence. Then if only want to send 0x03, then only set the myCharValue as 0x03 could meet the requriement. Something like:

    // Set the value to 0x03 once
    myCharValue = 0x03;

    // For notifications: just call it on a timer or whenever needed
    GATTServApp_ProcessCharCfg(myCharCfgTable, &myCharValue, FALSE,
    myAttrTable, numAttrs, taskId, myReadAttrCB);

    Best Regards,

    Barbara

  • Hello Barbara, thank you for your reply.

    I understand that by using GATTServApp_ProcessCharCf() and setting only 0x03, I can send only 0x03.

    What I would like to ask is how, within a single connection interval, if I decide to change the value to be sent via Notify, I can send only the last value I set without sending the value before the change (that is, if I have set the value to 0x00 with GATTServApp_ProcessCharCf() but the value I want to send changes to 0x03, how can I change it accordingly?).

    Thank you.

  • Hi Hiroki-san,

    Appliation layer can call GATTServApp_ProcessCharCf(), but when to send notification out is depending on stack and connection situation at that moment. Application can call GATTServApp_ProcessCharCf() with 0x00 first then call with 0x03 . If the invoke happen one after another in a short time, let us say <20ms, if connection interval for the connection is 50ms, then in high possibility the notification sent out will fall into the same connection event.  But it cannot grantee the change must happen in one connection interval if there are retransmission or other weak connection condition, or the en-queue operation missed the same connection event. Notification is naturally no need ACK from the peer device.  

    Best Regards,

    Barbara

  • Hello Barbara, thank you for your reply.

    I understand what you’re saying; however, it’s different from what I want to achieve.

    What I would like to do is, within a single connection interval, cancel the notification for the value once set via GATTServApp_ProcessCharCf(), and then send only the latest value—set again via GATTServApp_ProcessCharCf()—as a notification.

    I would appreciate your help.

  • Hi Hiroki-san,

    1 notificaiton packet is sent over the air per call of GATTServApp_ProcessCharCf(). I don't understand what does "cancel" mean here. Stop call GATTServApp_ProcessCharCf with old value and call GATTServApp_ProcessCharCf with new value will achieve the feature.

  • Hi Barbara.

    Let me give an example.

    There is a system that sends sensor value updates via Notification. I will talk about the case where the sensor value is updated twice between the previous connection event and the next connection event. Also, suppose that whenever the sensor value is updated, we call "GATTServApp_ProcessCharCf g". In that case, since "GATTServApp_ProcessCharCf g" is executed twice, I think two notifications will be sent in the next connection event.

    Therefore, what I want to do is to send only once—and only the latest information—via Notification in the next connection event.

    I would appreciate your help.