QN9080-001-M17-"BleApp_FlushUartStream"

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

QN9080-001-M17-"BleApp_FlushUartStream"

跳至解决方案
1,700 次查看
1758793535
Contributor I

I hope this function can be executed regularly, for example, every five seconds. What should I do?

thank you!

串口流更新1.png

0 项奖励
回复
1 解答
1,665 次查看
nxf56274
NXP Employee
NXP Employee

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.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,686 次查看
nxf56274
NXP Employee
NXP Employee

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.
-------------------------------------------------------------------------------

0 项奖励
回复
1,679 次查看
1758793535
Contributor I

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.串口刷新計時器,串口計時器開始.png

0 项奖励
回复
1,676 次查看
nxf56274
NXP Employee
NXP Employee

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.
-------------------------------------------------------------------------------

0 项奖励
回复
1,670 次查看
1758793535
Contributor I

Hello, I don't understand very clearly. Can you give me a simple example?

0 项奖励
回复
1,666 次查看
nxf56274
NXP Employee
NXP Employee

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.
-------------------------------------------------------------------------------

0 项奖励
回复