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 

Display text after SMS

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



Joined: 07 Jan 2008
Posts: 12

PostPosted: Thu Jan 10, 2008 1:49 pm    Post subject: Display text after SMS Reply with quote

I'm trying to display a little message to the screen everytime a SMS is received. After looking through the pager code, I took a stab at it. The basic code looks like:


Code:
/* message to display when we receive an SMS message*/
u8 PROGMEM sms_display_msg[] = "SMS message received!";

/* Function used to deal with the SMS action */
void action_sms(File_apdu_data *fd)
{
   dbsp ("Got the SMS\n");
   display_text_raw(sms_display_msg, Q_DISPLAY_TEXT_USER_CLEAR);
}


void turbo_handler (u8 action, void* data)
{
   switch(action)
   {
      case ACTION_INSERT_MENU:
         /* make something appear in the menu*/
         insert_menu ("SMS check");
         break;
         
      case ACTION_SMS:
         /* SMS received, display text*/
         stk_thread (action_sms, data);
         break;
         
      case ACTION_APP_REGISTER:
         reg_action (ACTION_SMS);
      break;
         
      default:
      break;
   }
}


I tried to register the SMS action both using ACTION_APP_INIT and ACTION_APP_REGISTER (commenting out one then the other). Also I tried both dbsp() and display_text_raw() to show the text, commenting out one then the other. In every case, nothing happens on the screen after sending an SMS. Looking at the trace, there is an unknown envelope command that happens after the SMS is received, but I don't know what that is.

Note: I tried helloworld on the phone and the text there displayed fine.

What am I doing wrong?
Back to top
View user's profile Send private message
littleB



Joined: 07 Jan 2008
Posts: 12

PostPosted: Thu Jan 10, 2008 1:51 pm    Post subject: Reply with quote

I should probably mention that I'm doing this using the TurboSIM. I'm programming it with the Programmer. The text inserted into the menu is just a sanity check to make sure that the program was downloaded to the SIM OK.
Back to top
View user's profile Send private message
pz
Guest





PostPosted: Fri Jan 11, 2008 7:35 am    Post subject: Reply with quote

Your code looks ok, it's possible that SMS is not actually stored on SIM and kept in phone memory. This behaviour is phone dependant. You may try to fill internal phone memory and keep sim free.
Back to top
littleB



Joined: 07 Jan 2008
Posts: 12

PostPosted: Mon Jan 14, 2008 10:05 pm    Post subject: Reply with quote

pz wrote:
Your code looks ok, it's possible that SMS is not actually stored on SIM and kept in phone memory. This behaviour is phone dependant. You may try to fill internal phone memory and keep sim free.


I have tried a few more things and have narrowed things down a bit. In sending the SMS from an emulator, if I use a PID of 0x7F (comes to SIM as envelope command), the card seems to crash (card connection error). If instead I use a PID of 0x41 (arrives as an update record), the code works perfectly and the text is displayed fine.

I added registration for all the SMS actions I could find (including Turbo SMS), and have a separate function and text display for each action, but that has not changed anything. Depending on the PID the code works or the card crashes. But I don't want to rely on the PID, I want to be able to cover all cases.

Any ideas?
Back to top
View user's profile Send private message
littleB



Joined: 07 Jan 2008
Posts: 12

PostPosted: Tue Jan 15, 2008 9:44 pm    Post subject: Update, still need help Reply with quote

pz -- I have been doing some more testing as I have time. I now have it so that there is no crashing, but there is still a PID problem. I can use any PID except 0x7F to send an SMS and have the code work. If I use a PID of 0x7F, nothing happens, no crash, no message; although I can see where the SIM gets it and responds with a MO SMS if the OTA setup (in the emulator) requests it.

I know that often the Turbo SMS will pick up on that PID and try to do some filtering on it, but even if I go to the setup and change the PID to use 0x00 for turbo SMS, still no action event happens for incoming SMS's with a PID of 0x7F. Is there anything I can do to make sure the Turbo generates some kind of event for that SMS? Any kind of action would be nice.

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





PostPosted: Sat Jan 19, 2008 11:41 am    Post subject: Re: Update, still need help Reply with quote

littleB wrote:
pz -- I have been doing some more testing as I have time. I now have it so that there is no crashing, but there is still a PID problem. I can use any PID except 0x7F to send an SMS and have the code work. If I use a PID of 0x7F, nothing happens, no crash, no message; although I can see where the SIM gets it and responds with a MO SMS if the OTA setup (in the emulator) requests it.

I know that often the Turbo SMS will pick up on that PID and try to do some filtering on it, but even if I go to the setup and change the PID to use 0x00 for turbo SMS, still no action event happens for incoming SMS's with a PID of 0x7F. Is there anything I can do to make sure the Turbo generates some kind of event for that SMS? Any kind of action would be nice.

Thanks


As for 0x7F/Turbo SMS - have you tried e.g. locate application? Good for testing. Or you can use Setup->Turbo SMS->Test.

Your goal is to have SMS stored on SIM - this is not PID but DCS related - class says how the incoming SMS should be handled. Generic SMS are class 0 meaning it's up to phone where to store it but you can say "store it into SIM".
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