Hi,
i need some help - i want to do following:
I have serial connection to a PC and I want to send commands from PC to the Board.
A command from the PC could be "comm_setRelais1" or what ever.
My idea was, to send escape sing in front and after each command, so that i can parse the string with chibi easyly.
But it is not so easy as I thought.
I have no idea, wich Driver Routine I should use - how do the different receive methods behave?
Does uartStartReceive capture ALL received signs? What happens if buffer is full? Do I have to manualy empty it?
I couldn't find any good example or explanation on the UART Driver for such things - is there a part in the Docu I have missed?
Best regards
Stomper
How to react to incoming UART Messages?
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: How to react to incoming UART Messages?
Hi,
The Serial driver is better than the UART driver in that scenario, you can read one char at time because the driver is buffered.
Giovanni
The Serial driver is better than the UART driver in that scenario, you can read one char at time because the driver is buffered.
Giovanni
Re: How to react to incoming UART Messages?
Thanks for that information.
Is there some example code how to manage receiving strings with the UART Driver?
And:
Best regards
Stomper
Is there some example code how to manage receiving strings with the UART Driver?
And:
Stomper85 wrote:Hi,
What happens if buffer is full? Do I have to manualy empty it?
Best regards
Stomper
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: How to react to incoming UART Messages?
Yes, look into shell.c, there is a function reading lines of text using streams (so SERIAL driver, not UART driver).
Giovanni
Giovanni
Re: How to react to incoming UART Messages?
But in your first post you said, the UART Driver would be better.
What should I use now?
SERIAL or UART?
And how does the Buffer behave? Is it a ring-buffer or do I have to empty it manually?
What happens if several messages coming in very fast?
Isn´t there a small code snippet to see how to use UART the right way as receiver?
What should I use now?
SERIAL or UART?
And how does the Buffer behave? Is it a ring-buffer or do I have to empty it manually?
What happens if several messages coming in very fast?
Isn´t there a small code snippet to see how to use UART the right way as receiver?
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: How to react to incoming UART Messages?
I wrote that serial would be better...
It has ring buffers and you are responsible for reading them quick enough, no explicit empting required.
Giovanni
It has ring buffers and you are responsible for reading them quick enough, no explicit empting required.
Giovanni
Re: How to react to incoming UART Messages?
Sorry,
I got that wrong.
Normaly I am hardware developer - so software is kind of strange for me
I try the SERIAL driver, the examples of the shell.c should do.
Best regards
Stomper
I got that wrong.
Normaly I am hardware developer - so software is kind of strange for me
I try the SERIAL driver, the examples of the shell.c should do.
Best regards
Stomper