CC2340R5: Data transmission with fix interval

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG,

Tool/software:

Hi Team, 

Can I lab on data transmission for C2340R5. I need to send transmit data every 1 second to mobile app. I have gone through data_stream example. Partially that lab is convinced to me for changing UUID, getting data notifed by intially sending data from mobile to MCU. I am looking for interrupt based data transmission irrespective of any data send from mobile to MCU. Every 1 second MCU should send data to Mobile without any other interference needed.

  • Hi !

    If you want to transmit data to a phone, you should use Bluetooth Low Energy. There are two possibilities to send the BLE data :
    - You could send the data through BLE advertisements. This doesn't require and active BLE connection between the MCU and the phone.
    - You could send the data through BLE notifications. This requires to have an active BLE connection, but the data sent can be encrypted.

    If you want to use advertisements, you can follow this SLA guide and read this chapter of the user guide. If you want to use notifications, you can see how the basic_ble example sends notifications through the characteristic 4, and read this chapter of the user guide. You will need to use the GATT_Notification function of the API.

    However, you can't force the data transmission using interruptions in Bluetooth Low Energy. The BLE stack sends the data every advertisement interval and sends notifications every connection interval. A solution is to set the advertising interval or connection interval to 1 second.

    Kind regards,
    Maxence

  • Additionally :

    - If you chose to use BLE advertisements, our BLE stack have a feature called periodic advertisements which fit your use case nicely. 
    - If you chose to use BLE notifications, you will have more guarantee that the data is received correctly, because the central will reply with a acknowledgement. If this acknowledgement is not received by the peripheral, the notification is re-transmitted in the next connection interval.

  • Hi Team, We set the advertising and connection intervals to 1second in sysconfig. In addition to this we created a task which every second sends a notification. We observed that the task runs smoothly when there is no ble connection and when the ble connection starts, and I subscribe to that characterstic, my application freezes. Is there any way for me to send notifcations every one second in the connected state?

  • Hi !

    Is it your mobile application that is freezing, or the firmware on your CC2340R5 ? How do you know it's freezing ?

    Creating a task that sends out a notification every second sounds like it would take a lot of memory and CPU usage for nothing. The best alternative for you would be to use a timer with a timeout of 1 second, that would send the notification in the timer callback. You can see how to setup the timer with ClockP in the SimpleLink Academy Training about this.

    Kind regards,
    Maxence

  • Hello Sahil,

    Please open a new thread in case you have further questions.
    Closing this one due to inactivity.

    Thanks.