| ??? 01/02/04 14:44 Read: times |
#61742 - RE: Whats wrong with good ol pointer/global? Responding to: ???'s previous message |
well, thats tricky!
if you are working with strings, you got to have two things - the string itself and a pointer. as far as processing strings in from a serial port is concerned, you need a buffer of sufficient length. Especially if you are looking them up in a table. As for protocol processing, you can check the frame against the immidiate byte, dont need to store anywhere. Can have a state variable that indicates the paramter number/type/state of packet and check the received byte. Next you have to store the data in a suitable buffer, and then work on it. You cant simply issue a command and wait for the date to arrive. Most of the protocol processing esp. packet frame checking can be done in the ISR itself, but make sure it isnt too long. A state variable comes handy, just switch to an appropriate section of code to process the byte at hand. regards, girish |



