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
  • This has nothing specifically to do with the 8051 nor Keil - it is a standard 'C' text parsing exercise.

    The "preamble" giving the sender number, etc, is in a standard format with well-defined delimiters between the elements.
    So you just need to "walk" through those elements - and what follows them must be your application-specific text!

    Or, perhaps, you could start at the end of the response and work backwards to the start of your application-specific text!

    Converting the digit characters from a text string into a numeric value is trivial...

Reply
  • This has nothing specifically to do with the 8051 nor Keil - it is a standard 'C' text parsing exercise.

    The "preamble" giving the sender number, etc, is in a standard format with well-defined delimiters between the elements.
    So you just need to "walk" through those elements - and what follows them must be your application-specific text!

    Or, perhaps, you could start at the end of the response and work backwards to the start of your application-specific text!

    Converting the digit characters from a text string into a numeric value is trivial...

Children
More questions in this forum