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.

CC2745R10-Q1: How to use BLEAppUtil_startTimer

Part Number: CC2745R10-Q1

I want to perform BLE "notifications" at regular intervals and am trying to modify basic_ble as a base. To achieve a fixed interval, I thought the API "BLEAppUtil_startTimer" might be useful, but I couldn't find it in the API manual or elsewhere.


So, I have a few questions:
(1) Please tell me how to use BLEAppUtil_startTimer.
(2) If I want to perform processing at regular intervals, is it correct to use this API? If there is a better method, please let me know.

 

 

Best regards. 

  • Hello,

    You can use BLEAppUtil_startTimer:

    /*********************************************************************
     * @fn      BLEAppUtil_startTimer
     *
     * @brief   Start a timer instance
     *
     * @param   timerCB     - callback function that will be called when the timer expired
     * @param   timeInMS    - the time to set in the timer
     * @param   isPeriodic  - a flag that indicates if the timer is periodic or not
     * @param   pData       - the data to pass to the timer callback
     *
     * @return  Returns the timer handle
     */
    BLEAppUtil_timerHandle BLEAppUtil_startTimer(BLEAppUtil_timerCB_t timerCB, uint32_t timeInMS, bool isPeriodic, void *pData);

    You can find the information above in <project root>/common/BLEAppUtil/inc/bleapputil_timers.h.

    It's usage is what is described in the header. You provide a callback function that will be invoked when the timer expires, the amount of time before expiration in milliseconds, whether the timer is periodic (should it occur every x amount of ms, or just one time) and data that should be passed to the callback function.

    Alternatively, you can use the ClockP driver: ClockP.h File Reference

    The BLEAppUtil_startTimer actually uses the ClockP driver behind the scenes and is provided for convenience but if you wanted further control over the timer then use ClockP directly.

    Hope that helps!

    Best,

    Nima Behmanesh

  • Hello,

    Thank you for your response. I understand now regarding the usage.

    There seems to be another function named “BLEAppUtil_”, but is there any explanation about these in the API specification?

    If so, I would appreciate it if you could tell me where they are described.

    Best regards.

  • Hello,

    We will have dedicated documentation for the BLEAppUtil API soon. For now, you can refer to the <project-root>/common/BLEAppUtil/inc/bleapputil_api.h file for more information regarding the BLEAppUtil API.

    Best,

    Nima Behmanesh