Dialog Semiconductor customer support - uart multi thread https://support.dialog-semiconductor.com/resource-keywords/uart-multi-thread en DA14580 DK-basic using UART problem https://support.dialog-semiconductor.com/da14580-dk-basic-using-uart-problem

Hi, dialog

my task is to use the development kit as a dongle, and transmit received data (notification) to the PC via UART.
my question is: is it possible that the DK "listen" for the command sent by PC (via UART), meanwhile receiving the data sent by a connected peer device, and transmit it to the PC via UART. i.e. work like multiple thread task.
I have read and run the uart2_async project.

(1). For uart2_read_test:
it seems that the RECEIVED_AVAILABLE interrupt only trigged when you call uart2_read((uint8_t *)buffer, READ_CHAR_COUNT, uart2_read_completion_cb); and there are READ_CHAR_COUNT bytes of data exist. and it is executed only once, that is it does not keep listening the serial port.

(2) For uart2_loopback_test
seems it could do the job, but I am not sure whether it could write the data received (from a peer device over air) to the UART at the same time?

Also, if it is a good practice to set a timer to listen the serial port? that is call uart2_read function periodically.

Thanks!

Device: 
Thu, 21 Jul 2016 15:15:43 +0000 wenkangl 4251年https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/da14580-dk-basic-using-uart-problem#comments