cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Bluetooth

JeHu_3414236
Contributor II

I am using 20719 and I want to go to PDS after UART Tx is done after I call wiced_hal_puart_synchronous_write().  In the sleep handler, I always allow PDS when I get the event WICED_SLEEP_POLL_SLEEP_PERMISSION.  However, it seems the UART Tx is not finished when I get this event and UART Tx will stop in PDS.  How do I check UART Tx is really finished so I can go to PDS?  If I call wiced_rtos_delay_milliseconds(50, KEEP_THREAD_ACTIVE) after wiced_hal_puart_synchronous_write(), the UART Tx will finish before PDS but I don't want to put in a busy wait.

0 Likes
Reply
1 Solution
AnjanaM_61
Moderator
Moderator

Hi,

There is no API to know whether UART Tx done or not.

Also PUART will be off during PDS.

So you have to write the application logic in such a way that , before doing any PUART write, it should not be in any sleep mode.

You may send a acknowledge from the peer device after receiving the PUART tx data from our side and upon receiving the ACK, put the 20719 in PDS again. Can you try some logic like that?

Thanks,
Anjana

View solution in original post

2 Replies
AnjanaM_61
Moderator
Moderator

Hi,

There is no API to know whether UART Tx done or not.

Also PUART will be off during PDS.

So you have to write the application logic in such a way that , before doing any PUART write, it should not be in any sleep mode.

You may send a acknowledge from the peer device after receiving the PUART tx data from our side and upon receiving the ACK, put the 20719 in PDS again. Can you try some logic like that?

Thanks,
Anjana

View solution in original post

JeHu_3414236
Contributor II

I will try something on the application level. Thanks.

0 Likes
Reply