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.

CC2652RB: How to send data at a fixed frequency?

Part Number: CC2652RB

Hi team,

Here's the request from the customer:

Customer wants to send EEG data via bluetooth. The data is 6 bytes and how to make these data sent by setting a certain frequency interval?

Customer's understanding is to always update the structure corresponding to a service feature which is the sunlightService_UpdatePeriodVal in the first figure. But he found that project_zero is a thread of the main function, so can him create another EEG acquisition thread to update this sunlightService_UpdatePeriodVal array data? If not, what should him do to make bluetooth always send a 6-byte data which is a always-updating array?

Could you help check this case? Thanks.

Best Regards,                                                       

Nick    

  • Hi Nick,

    If the customer is interested in sending data at a fixed frequency, then I would suggest implementing a timer or clock callback at the desired time interval. Within the callback, a GATT notification can be enqueued to send the newly updated data. I would suggest referencing the simple_peripheral project as this project has a periodic event built in by default that can be used as a starting point to implement the desired functionality. To learn about notifications and how to work with them, then I would suggest the customer reference the Generic Attribute Profile (GATT) chapter of the User's Guide, the HID over BLE example, and the throughput_peripheral example. The examples show how to use the GATT_Notification() function and the documentation provides some theory behind how notifications work. The Clock chapter of the user's guide also contains valuable information on how to set up periodic events.

    Best Regards,

    Jan

  • Hi Jan,

    If there is no need for a certain interval, as long as there is data, it will be sent immediately? How should 6 bytes of data be sent?

    Best Regards,

    Nick

  • Hi Nick,

    If there is no need for a certain interval, then the customer can simply write the data to a custom characteristic and if the peer device has enabled notifications, then they will received a notification whenever the characteristic is updated.

    Best Regards,

    Jan