Hello,
I have to implement a callback function for RX. I have a variable command which will be sent from terminal. For eg , in this data block can be 1 byte or 200 bytes and rest are fixed.
STX , Address, SEQ Number, DataBlock(n), ETX, CRC.
I am using Ring buffer method.
For now i am using the sample example of twrke18f_lpuart_interrupt_rb_transfer. The buffer is fixed to 8 , so it receives only 8 bytes.
sendXfer.data = g_txBuffer;
sendXfer.dataSize = ECHO_BUFFER_SIZE;
receiveXfer.data = g_rxBuffer;
receiveXfer.dataSize = ECHO_BUFFER_SIZE;
I do get a complete data
02 0x31 0x31 Z 0x03 0xCRC
I can not get variable frame ,For my example how do i trigger call back when ETX is received without depending on the size as above.
Attaching code files.
Please help with expert guidance