View previous topic :: View next topic |
Author |
Message |
xindy Guest
|
problem with the @ character |
Posted: Fri Apr 18, 2008 1:34 am |
|
|
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:mypasswd@192.168.1.2/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
|
|
Posted: Fri Apr 18, 2008 1:48 am |
|
|
You can try to escape it with a '\' before.
But it is strange a problem.
Matro. |
|
|
xindy Guest
|
|
Posted: Fri Apr 18, 2008 1:56 am |
|
|
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
|
|
Posted: Fri Apr 18, 2008 2:07 am |
|
|
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
|
|
Posted: Fri Apr 18, 2008 2:26 am |
|
|
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
|
|
Posted: Fri Apr 18, 2008 2:44 am |
|
|
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
|
|
Posted: Fri Apr 18, 2008 3:11 am |
|
|
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
|
|
Posted: Fri Apr 18, 2008 3:34 am |
|
|
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 .
Fast reply, bad reply...
Matro |
|
|
Ttelmah Guest
|
|
Posted: Fri Apr 18, 2008 4:18 am |
|
|
Know the feeling too well.
Best Wishes |
|
|
xindy Guest
|
thanks |
Posted: Mon Apr 21, 2008 10:12 pm |
|
|
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.. |
|
|
|