QN9080-001-M17-"BleApp_FlushUartStream"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QN9080-001-M17-"BleApp_FlushUartStream"

Jump to solution
1,247 Views
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 Kudos
1 Solution
1,212 Views
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.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
5 Replies
1,233 Views
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 Kudos
1,226 Views
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 Kudos
1,223 Views
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 Kudos
1,217 Views
1758793535
Contributor I

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

0 Kudos
1,213 Views
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 Kudos