bladox.com Forum Index bladox.com
Turbo SIM Toolkit Adapter Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

am I using stk_cmd correctly?

 
Post new topic   Reply to topic    bladox.com Forum Index -> Development
View previous topic :: View next topic  
Author Message
progress
Guest





PostPosted: Mon Aug 07, 2006 8:44 pm    Post subject: am I using stk_cmd correctly? Reply with quote

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





PostPosted: Thu Aug 10, 2006 3:09 pm    Post subject: Reply with quote

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





PostPosted: Fri Aug 11, 2006 7:00 pm    Post subject: Reply with quote

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

PostPosted: Mon Nov 17, 2008 9:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
jbladox



Joined: 29 Jul 2008
Posts: 24

PostPosted: Tue Nov 18, 2008 7:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
pz
Guest





PostPosted: Thu Nov 20, 2008 8:25 am    Post subject: Reply with quote

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

PostPosted: Thu Nov 20, 2008 1:28 pm    Post subject: Reply with quote

Oh okay. I get it. I was expecting to see OK/ERROR printed out in ASCII in the answer.

Thank you.
Back to top
View user's profile Send private message
ykerlou



Joined: 24 May 2008
Posts: 6

PostPosted: Tue Mar 17, 2009 7:02 pm    Post subject: Any news on that topic ? Reply with quote

Hi guys,
any update on that subject ? Did you get "AT command" working ?

Regards,

Yves
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bladox.com Forum Index -> Development All times are GMT
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