I hope this function can be executed regularly, for example, every five seconds. What should I do?
thank you!
Solved! Go to Solution.
Hi,
代码里面有个功能就是定时器功能,它可以定时发消息。你可以看一下private_profile_server和client的例程。这个是计算ble的传输速度的,他就是用的定时器。这个定时器首先你要静态定义一个变量,然后使用TMR_AllocateTimer来给变量分配一个定时器ID,然后使用TMR_StartLowPowerTimer来启动定时器,其中第四个参数就是你要执行的回调函数,你要执行什么函数就把函数地址放进去。第二个参数,你可以选择这个定时器是一次性的还是连续的,你想不断发就用gTmrLowPowerIntervalMillisTimer_c,第三个参数就是时间,你自己设就好了。最后不想用这个定时器就TMR_StopTimer,停掉你的这个定时器。
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi,
Use a timer to call this function. use 'TMR_StartLowPowerTimer' to start the timer.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Are you talking about the two functions in the picture ?
After connecting to the mobile phone, these two functions do not seem to be executed, and the data is not received on the mobile phone.
Hi,
No. I mean that you need define your own timer. Put that function as callback to your timer.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hello, I don't understand very clearly. Can you give me a simple example?
Hi,
代码里面有个功能就是定时器功能,它可以定时发消息。你可以看一下private_profile_server和client的例程。这个是计算ble的传输速度的,他就是用的定时器。这个定时器首先你要静态定义一个变量,然后使用TMR_AllocateTimer来给变量分配一个定时器ID,然后使用TMR_StartLowPowerTimer来启动定时器,其中第四个参数就是你要执行的回调函数,你要执行什么函数就把函数地址放进去。第二个参数,你可以选择这个定时器是一次性的还是连续的,你想不断发就用gTmrLowPowerIntervalMillisTimer_c,第三个参数就是时间,你自己设就好了。最后不想用这个定时器就TMR_StopTimer,停掉你的这个定时器。
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------