AnsweredAssumed Answered

non-blocking write and read, writes and reads respectively  only the first character of the string (Txed or Rxed)

Question asked by CHANDRASEKAR KANNIAPPAN on Sep 30, 2013
Latest reply on Oct 1, 2013 by David E Seymour

Tower K60.

I have fisrt installed uart2 from user_config.h so init_bsp.c installs UART2 at this line...

_kuart_polled_install("ttyc:", &_bsp_sci2_init, _bsp_sci2_init.QUEUE_SIZE);

 

then opened it with "myapp.c"

MQX_FILE_PTR fPtr = fopen("ttyc:", NULL);

int uartparam = 0 | IO_SERIAL_NON_BLOCKING | IO_SERIAL_TRANSLATION;

ioctl( fPtr, IO_SET_SERIAL_FLAGS, &uartparam);

 

write(fPtr, "HELLO", 5); writes only the first character 'H'.

and

read(fPtr, rdBuffer, 16); reads only the first character sent from hyperterminal on PC.


What should I do to write a whole string and read a whole string in non-blocking mode?

Outcomes