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

problem with the @ character

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







problem with the @ character
PostPosted: Fri Apr 18, 2008 1:34 am     Reply with quote

hi.. i have a pic(18f4525) that is incorporated to a gprs modem(MC55).. everthing went fine until i try to send data via gprs using ftp.. in the data sheet of gprs modem : this code is part of the initialization process that should be done in order to open a connection -> e.g.
at^siss=1,address,"ftpput://myname:[email protected]/upload/example.txt"
the problem however is that the pic cant seem to process this code because of the @ character. If i delete the @ character, the pic will continue to read the next line of code but it obviously wont create a gprs connection because it doesnt follow the format given by the gprs modem. my question is why? do i have to do something special with the @ char? please help.. thanks..
Matro
Guest







PostPosted: Fri Apr 18, 2008 1:48 am     Reply with quote

You can try to escape it with a '\' before.
But it is strange a problem.

Matro.
xindy
Guest







PostPosted: Fri Apr 18, 2008 1:56 am     Reply with quote

yes indeed.. this is really a strange problem.. i have already tried your suggestion but it still wont work.. i dont know what seems to be the problem. i dont know what is in the @ character that prevents the pic from working. please help..
Matro
Guest







PostPosted: Fri Apr 18, 2008 2:07 am     Reply with quote

Could you post the code line that you use to send the string and a few lines before and after this one?

Matro
Ttelmah
Guest







PostPosted: Fri Apr 18, 2008 2:26 am     Reply with quote

There is nothing special about the '@' character.
Multiple thoughts:
1) You can try incorporating the character as the escaped octal value. So:
"ftpput://myname:mypasswd\100192.168.1.2/upload/example.txt".
2) Check with charmap, what the '@ character actually corresponds to on your computer. You can get this type of problem, if you are using an odd language setup, so that '@', is not 0x40. The language handling in the OS, 'knows' about this,and automatically translates it before transmission, but the PIC doesn't.
3) The fact that the backslash escape doesn't work, possibly suggests that the problem is actually 'deeper', than the CCS language, and that the '@' character, may not represent what it normally does!.
4) Presumably you are transferring this sequence into a string for transmission?. Consider doing this in multiple parts, transfer the stuff up to the '@', append the '@', then append the rest.
5) Double check the lines in front of, and this problem. It is common to have this type of 'inexplicable' failure, when a small error some lines before, suddenly triggers a problem.
I have just tried generating this string, and it works fine.

Best Wishes
Matro
Guest







PostPosted: Fri Apr 18, 2008 2:44 am     Reply with quote

Ttelmah wrote:
There is nothing special about the '@' character.
Multiple thoughts:
1) You can try incorporating the character as the escaped octal value. So:
"ftpput://myname:mypasswd\100192.168.1.2/upload/example.txt".

'@' decimal value is 64 so the correct line is :
"ftpput://myname:mypasswd\64192.168.1.2/upload/example.txt"
I suspect Ttelmah done a "extra conversion" (0x64 -> 100). ;-)

Matro.
Ttelmah
Guest







PostPosted: Fri Apr 18, 2008 3:11 am     Reply with quote

The value after the '\' escape in C, is three digits representing an _octal_ value, or has to have the '0x' and be in hexadecimal.
'@', is 100 in octal.

Best Wishes
Matro
Guest







PostPosted: Fri Apr 18, 2008 3:34 am     Reply with quote

Ttelmah wrote:
The value after the '\' escape in C, is three digits representing an _octal_ value, or has to have the '0x' and be in hexadecimal.
'@', is 100 in octal.

Best Wishes

Triple Embarassed .
Fast reply, bad reply... Confused

Matro
Ttelmah
Guest







PostPosted: Fri Apr 18, 2008 4:18 am     Reply with quote

Know the feeling too well. Smile

Best Wishes
xindy
Guest







thanks
PostPosted: Mon Apr 21, 2008 10:12 pm     Reply with quote

hi.. i finally figure it out.. thank GOD!! there really was nothing wrong with how ccs handle the @ character. it was just a matter of setting the gsm module to the right character set that can use characters like the @. thanks for all your help.. please do continue to support and help newbies like me.. Very Happy
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