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:如何使用 BLEAppUtil_startTimer

Guru**** 2644985 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1582897/cc2745r10-q1-how-to-use-bleapputil_starttimer

器件型号:CC2745R10-Q1


我想定期执行 BLE“通知“、并尝试修改 basic_ble 作为基础。 为了实现固定的时间间隔、我认为 API“BLEAppUtil_startTimer"可能“可能很有用、但在 API 手册或其他地方找不到。


所以,我有几个问题:
(1) 请告诉我如何使用 BLEAppUtil_startTimer。
(2) 如果我要定期执行处理、使用此 API 是否正确? 如果有更好的方法、请告诉我。

 

 

此致。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    可以使用  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);

    您可以在中找到上述信息 /common/BLEAppUtil/inc/bleapputil_timers.h.

    它的用法是标头中描述的内容。 您提供了一个在计时器到期时将调用的回调函数、到期前的时长(以毫秒为单位)、计时器是周期性的(如果它是每 x 毫秒发生一次,还是只发生一次)以及应传递给回调函数的数据。

    或者、您可以使用 ClockP 驱动程序: ClockP.h 文件参考

     BLEAppUtil_startTimer  实际上在后台使用 ClockP 驱动程序、为方便起见而提供、但如果您需要进一步控制计时器、请直接使用 ClockP。

    希望这能有所帮助!

    此致、

    Nima Behmanesh

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    感谢您的答复。 我现在了解有关使用的信息。

    似乎有另一个名为“BLEAppUtil_"的“的函数、但 API 规范中是否对此有任何解释?

    如果是这样、请你告诉我它们的描述。

    此致。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    我们很快就会有 BLEAppUtil API 的专门文档。 现在、您可以参考  /common/BLEAppUtil/inc/bleapputil_api.h  文件、了解有关 BLEAppUtil API 的更多信息。

    此致、

    Nima Behmanesh