RoyceyBaby
IS-IT--Management
- Mar 23, 2001
- 22
I am an extreme newbie to C.
I am trying to write a program that reads/write data from/to a serial port.
I have mananged to get a small program that reads data in from the serial port using the select statement.
What I read in is whatever is in the buffer of the serial port. As such I get fragments of information.
What I read in could be something like this
First Select Call "Command 1\nCommand 2\nCom"
Second Select Call "mand 3\n"
I append all the data to one string
BufferString="Command 1\nCommand 2\nCommand 3\n"
How do I pull off each command. I think it is something to do with pointers, a kick in the general direction and I would be very grateful.
Many thanks,
Royce
I am trying to write a program that reads/write data from/to a serial port.
I have mananged to get a small program that reads data in from the serial port using the select statement.
What I read in is whatever is in the buffer of the serial port. As such I get fragments of information.
What I read in could be something like this
First Select Call "Command 1\nCommand 2\nCom"
Second Select Call "mand 3\n"
I append all the data to one string
BufferString="Command 1\nCommand 2\nCommand 3\n"
How do I pull off each command. I think it is something to do with pointers, a kick in the general direction and I would be very grateful.
Many thanks,
Royce