How do i set my UART to receive until a carriage return (\n)... **then do something**... then start receiving
Hello,
I am struggling to understand how i would set up my uart to receive data until it sees a carriage return (\n) then to check this the rx and then to act on it. For example if i sent " on\r" it would turn an LED on
I am using the STM32Cube, Nucleo-103RB and Keil IDE
I have set up HAL_UART_Receive_IT so i can see the data being stored from the Tx, once 5 characters it will call HAL_UART_RxCpltCallback where this will toggle my LED and restart the interrupt reception. i did try and use strcmp() to compare strings but i couldn't get this to work.
i did read about setting up a idle line interrupt but ,again, i didn't understand it.
is there a simple way for receiving uart messages without knowing the length?
(im looking to use the HAL Drivers)
any help or guidance would be appreciated!
Kind regards,
Mike
