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 

AT Commands

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



Joined: 04 Sep 2010
Posts: 20

PostPosted: Tue Sep 07, 2010 4:00 pm    Post subject: AT Commands Reply with quote

I am trying to implement STK_CMD_RUN_AT_COMMAND.

I have based my code on some of the previous examples.

I know that the handset supports the sending of AT commands, and yet all that happens is that the phone hangs as soon as the command is executed. I tried a couple of handsets, and had the same problem each time.

Any thoughts?

The code is below:


#include <config.h>
#include <turbo/turbo.h>
#include <stdlib.h>
#include <string.h>

u8 PROGMEM t_Foo_en[] = "Fail!";

void action_menu (void *data)
{
u8 len = 0; //traverse through the buffer
u8 *buf = buf_A(); //buffer for APDU/simple TLV
u8 *response; //the response of the AT command
u8 resp_buf;
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);
resp_buf = get_tag(response, T_RESULT);
if (resp_buf != 0)
{resp_buf++;
resp_buf++;
display_text_raw (response[resp_buf] , Q_DISPLAY_TEXT_USER_CLEAR);
}
else{
display_text_raw (t_Foo_en , Q_DISPLAY_TEXT_USER_CLEAR); }
}

void turbo_handler (u8 action, void *data)
{
switch (action)
{
case ACTION_INSERT_MENU:
insert_menu (t_Foo_en);
break;
case ACTION_MENU_SELECTION:
stk_thread (action_menu, data);
break;
default:
break;
}
}
Back to top
View user's profile Send private message
pz
Guest





PostPosted: Wed Sep 15, 2010 10:36 am    Post subject: Reply with quote

Code looks good, do you have TP2 to log the communication?

What phone is this?
Back to top
johnsecret



Joined: 04 Sep 2010
Posts: 20

PostPosted: Wed Sep 15, 2010 3:05 pm    Post subject: Reply with quote

Great, I'm pleased the code is good - that is very reassuring

Alas , you were out of stock of TP2 when I bought the TS

The phone is running WM 6.1 - Vodadone HTC KAIS130

Many thanks
Back to top
View user's profile Send private message
pz
Guest





PostPosted: Thu Sep 16, 2010 8:16 am    Post subject: Reply with quote

Maybe you could try to add buf[len++] = '\r';

TP2 should be available in 2-3 weeks.
Back to top
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