This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

deciphering the sms response Keil oriented,the string manipulations

(using a phone as a modem gsm).Avoiding the problems of delays,AT gramathic having a lucky of using textmode,I waiting a string of only 4 numbers,but I receive also of course a lot information as sender number,time,..the "okeys"back from the phone etc.I hear that this is a question of strings conversions.I can not just compare the response with a previous stored response because after a string 4 numbers are received I need to decode those numbers(converting to integer) and read each and every one of them independent(I can not compare 9999 "posibles commands")
-how can I extract those 4 numbers(the only text)and avoid all the other unpleasent data that is coming on uart
maybe you have few examples,recomended functions or something else

Parents
  • I really can't see this as an exercise. Stripping a response string into the individual fields and picking up the relevant information is a quite trivial operation.

    Scanning from the start has the big advantage that the processor may throw away irrelevant information on-the-fly which may possibly reduce the required buffer sizes. I normally use a state machine and work character for character through the data.

    It takes time for the tranfer of serial data because of the baudrate. Processing the data while it arrives means that you can know the result a the same moment as you get the last character of the line.

    I work with the ARM tools, not the C51 tools. Must have missed anything about any bugs...

Reply
  • I really can't see this as an exercise. Stripping a response string into the individual fields and picking up the relevant information is a quite trivial operation.

    Scanning from the start has the big advantage that the processor may throw away irrelevant information on-the-fly which may possibly reduce the required buffer sizes. I normally use a state machine and work character for character through the data.

    It takes time for the tranfer of serial data because of the baudrate. Processing the data while it arrives means that you can know the result a the same moment as you get the last character of the line.

    I work with the ARM tools, not the C51 tools. Must have missed anything about any bugs...

Children