View previous topic :: View next topic |
Author |
Message |
jaime
Joined: 25 Nov 2005 Posts: 56 Location: Porto - Portugal
|
String Problem |
Posted: Wed Jan 11, 2006 2:01 pm |
|
|
Hello
I'm trying to connect my PIC to a Cell phone.
The phone sends to the PIC this message
+CPBR: 1,"123456789",129,"NAME"
And i need to read the number 123456789 betwen the "
how can i do it?
thanks
jaime |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Wed Jan 11, 2006 2:26 pm |
|
|
Here's a post that does something very similar: http://www.ccsinfo.com/forum/viewtopic.php?t=23953
Examine the receiver code in that post. It looks for the following string: 'Dave ' (note the space), and if it receives it, everything after that is accepted as data. I would modify it to look for '+CPBR: 1,"'. Note the double quote. Then you know that whatever you receive after that first double quote is the number you're looking for. Save those numbers to a string until you encounter another double quote, and you have what you're looking for.
Hope this helps. |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Jan 11, 2006 2:42 pm |
|
|
Jaime you are new in this forum. It is improbable that somebody just start writting code
for you after your inquiry. We can help you but the first movement is yours.
You could start reading and searching in this forum how another people had solve
similar problems, then write your own code and post it.
Surelly you will get a lot of help in this way, and the most important: I'm sure that
your next question will not be "how can i do it?"
Keep well,
Humberto |
|
|
jaime
Joined: 25 Nov 2005 Posts: 56 Location: Porto - Portugal
|
|
Posted: Thu Jan 12, 2006 8:28 am |
|
|
thanks to newguy and humberto
Jaime |
|
|
|