CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

String Problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jaime



Joined: 25 Nov 2005
Posts: 56
Location: Porto - Portugal

View user's profile Send private message Visit poster's website

String Problem
PostPosted: Wed Jan 11, 2006 2:01 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 11, 2006 2:26 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 11, 2006 2:42 pm     Reply with quote

Quote:

how can i do it?


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

View user's profile Send private message Visit poster's website

PostPosted: Thu Jan 12, 2006 8:28 am     Reply with quote

thanks to newguy and humberto

Jaime
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group