View previous topic :: View next topic |
Author |
Message |
progress Guest
|
Posted: Mon Aug 07, 2006 8:44 pm Post subject: am I using stk_cmd correctly? |
|
|
I have tried to run an AT command (AT+CGMI) to a GD67 and I'm trying to display the results on the screen. Unfortunately, the response (or what I think is the response) is garbage. (I removed a lot of code for simplicity's sake, so this is the basic gist of what I did)
Code: |
u8 len = 0; //traverse through the buffer
u8 *buf = buf_A(); //buffer for APDU/simple TLV
u8 *response; //the response of the AT command
buf[len++] = T_AT_CMD | CR_FLAG; //AT command
buf[len++] = 0x07;//len_text; //AT command length
buf[len++] = 'A';
buf[len++] = 'T';
buf[len++] = '+';
buf[len++] = 'C';
buf[len++] = 'G';
buf[len++] = 'M';
buf[len++] = 'I';
//execute the command
response = stk_cmd(STK_CMD_RUN_AT_COMMAND, 0x00, DEV_ID_ME, len);
response = sprintc(response, '\0');
display_text_raw (response, Q_DISPLAY_TEXT_USER_CLEAR);
|
Am I doing someting wrong?
Thanks. |
|
Back to top |
|
 |
pz Guest
|
Posted: Thu Aug 10, 2006 3:09 pm Post subject: |
|
|
The response=stk_cmd() points on buffer containing all TERMINAL RESPONSE, use get_tag() to find the answer intself. Also T_RESULT may be interesting to contain ME result code. Would be interesting to use debug kernel to see ME-SIM communication (in case you have prog). |
|
Back to top |
|
 |
progress Guest
|
Posted: Fri Aug 11, 2006 7:00 pm Post subject: |
|
|
Thank you. It is working, but not really. So far, all of my AT commands result in "ERROR" but at least its a normal AT response. |
|
Back to top |
|
 |
jbladox
Joined: 29 Jul 2008 Posts: 24
|
Posted: Mon Nov 17, 2008 9:48 pm Post subject: |
|
|
Is this the correct way to get the response? Because I don't seem to be getting any sensible answer (I get only garbage), and I'm doing practically the same thing.
response = stk_cmd(STK_CMD_RUN_AT_COMMAND, 0x00, DEV_ID_ME, length);
resp_buf = get_tag(response, T_RESULT);
And the result (OK/ERROR) should be in resp_buf now? |
|
Back to top |
|
 |
jbladox
Joined: 29 Jul 2008 Posts: 24
|
Posted: Tue Nov 18, 2008 7:42 pm Post subject: |
|
|
I've also played around with
get_tag(response, T_AT_RESPONSE)
and even
get_tag(response, T_AT_CMD) with no result (they both return 0x0000).
Using the Programmer/TLite to debug, I get the following:
TO ME: d0 12 81 03 01 34 00 82 02 81 82 a8 07 41 54 2b 43 40 4d 49 90 00
(the part beginning at a8 07... is the AT command -- AT+CIMI)
FROM ME: a0 14 00 00 0c
FROM ME: 81 03 01 34 00 82 02 82 81 83 01 31
So that tells me that somewhere in the second FROM ME line, there should be an OK/ERROR result, or the IMSI of my device, but that is clearly not the case.
Please help.
Thank you. |
|
Back to top |
|
 |
pz Guest
|
Posted: Thu Nov 20, 2008 8:25 am Post subject: |
|
|
jbladox wrote: | I've also played around with
get_tag(response, T_AT_RESPONSE)
and even
get_tag(response, T_AT_CMD) with no result (they both return 0x0000).
Using the Programmer/TLite to debug, I get the following:
TO ME: d0 12 81 03 01 34 00 82 02 81 82 a8 07 41 54 2b 43 40 4d 49 90 00
(the part beginning at a8 07... is the AT command -- AT+CIMI)
FROM ME: a0 14 00 00 0c
FROM ME: 81 03 01 34 00 82 02 82 81 83 01 31
So that tells me that somewhere in the second FROM ME line, there should be an OK/ERROR result, or the IMSI of my device, but that is clearly not the case.
Please help.
Thank you. |
The T_RESULT is "83 01 31", i.e 31, please see 11.14 for exact meaning. But it means phone didn't make it - it would be 00 or 0x otherwise. |
|
Back to top |
|
 |
jbladox
Joined: 29 Jul 2008 Posts: 24
|
Posted: Thu Nov 20, 2008 1:28 pm Post subject: |
|
|
Oh okay. I get it. I was expecting to see OK/ERROR printed out in ASCII in the answer.
Thank you. |
|
Back to top |
|
 |
ykerlou
Joined: 24 May 2008 Posts: 6
|
Posted: Tue Mar 17, 2009 7:02 pm Post subject: Any news on that topic ? |
|
|
Hi guys,
any update on that subject ? Did you get "AT command" working ?
Regards,
Yves |
|
Back to top |
|
 |
|