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
  • converting digit caracters from the string into a numeric value...of course... you sugest "start at the end of the response and work backwards to the start of your application-specific text!"
    because the information on the received sms string is at the end of the string text (the 4 caracters)
    But given the bugs with function for string conversions we've been seing on Keil like atoi,strtol,atof and the others,Im asking to the experts for a most robust way,or at last if you where in my place:how you should avoid those conversions bugs and extract the 4 caracters,or use others functions,.."text parsing exercise"

Reply
  • converting digit caracters from the string into a numeric value...of course... you sugest "start at the end of the response and work backwards to the start of your application-specific text!"
    because the information on the received sms string is at the end of the string text (the 4 caracters)
    But given the bugs with function for string conversions we've been seing on Keil like atoi,strtol,atof and the others,Im asking to the experts for a most robust way,or at last if you where in my place:how you should avoid those conversions bugs and extract the 4 caracters,or use others functions,.."text parsing exercise"

Children