Yes
There are other ways of doing it but why complicate things ?
You might like to consider using a character like '*' instead of '\n' as it will be easier to see what is going on if you need to print the characters as they are received for debugging
