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 

pz - please help. stk_cmd for sms

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



Joined: 04 Mar 2009
Posts: 23

PostPosted: Fri Mar 27, 2009 3:05 pm    Post subject: pz - please help. stk_cmd for sms Reply with quote

Do you have any idea what is wrong with this. I get a return 21 in the terminal response.

It means "Network currently unable to process command"
I tried just sending regular data with out UDH but it does not work either. It gets the same 0x21 response.

Thank you

Code:

res = msisdn (alpha);        
     if (res != ENULL && res != NULL)
     {   
      
      //ms = str2msisdn(&res[2],MSISDN_ADN, MEM_R);      
      ms = msisdncpy (res, MSISDN_ADN, MEM_R);      
      ms = msisdn2str (ms, MSISDN_ADN,MEM_R);      
      ms = str2msisdn (ms, MSISDN_SMS,MEM_R);
      
       tmp = malloc (20);
       //q = create_head_q (tmp, t_Position_mime, ms, MSISDN_ADN);
       //send_sms (tmp, q - tmp, ms, MSISDN_ADN, 0x16, tsms_pid (), NULL,
        //    NULL);
      mslen = ms[0];
      
      buf[len++] = T_SMS_TPDU | CR_FLAG;
      buf[len++] = 0;  // fill in length later 
      buf[len++] = 0x1; //0x41;   // user data header indicator = 1, SMS-SUBMIT
      buf[len++] = msg_ref++;      // TP-MR message reference   TODO increment this number by one each time
      for (i=0; i<mslen; i++)
      {
         buf[len++] = ms[i];
      }
      buf[len++] = 0x7F;   //TP-PID
      buf[len++] = 0x16;   //TP-DCS
      // add user data header here
      buf[len++] = 17;  // user data length   TODO fill this in
      buf[len++] = 11;   // user data header length
      buf[len++] = 0x7F;  // user data IE
      buf[len++] = 0;  // length of user data header IE
      buf[len++] = 0;   // null field      
      buf[len++] = 0;   // command packet length
       buf[len++] = 2;   // command packet length         
      buf[len++] = 0; // spi 1st octet
      buf[len++] = 0;  // spi 2nd octet
      buf[len++] = 4;  //
      buf[len++] = 'T'; // secure data
      buf[len++] = 'h';
      buf[len++] = 'i';
      buf[len++] = 's';
      buf[len++] = 'h'; // unsecure data
      buf[len++] = 'e';
      buf[len++] = 'l';
      buf[len++] = 'p';            
      buf[1] = len - 2 ;
      //for (i = 0; i < strlen(t_Text_ss); i++)
      //buf[len++] = rb(t_Text_ss+i);
       
      term_resp = stk_cmd (STK_CMD_SEND_SMS, 0x00, DEV_ID_ME, len);   

      len=term_resp[0];
      for(i=0;i<len;i++)
      {
         r = sprintch (r, term_resp[i]);         
      }
      r[len] = 0;
      
      display_text_raw (buf2,
          Q_DISPLAY_TEXT_HIGH_PRIORITY | Q_DISPLAY_TEXT_USER_CLEAR);
       
Back to top
View user's profile Send private message
jplaschke



Joined: 04 Mar 2009
Posts: 23

PostPosted: Fri Mar 27, 2009 3:31 pm    Post subject: Reply with quote

I believe destination needs to be Network?

I am testing this now
Back to top
View user's profile Send private message
jplaschke



Joined: 04 Mar 2009
Posts: 23

PostPosted: Fri Mar 27, 2009 3:40 pm    Post subject: Reply with quote

I tried setting destination to NETWORK as the spec says in clause 14 of 11.14
but now the phone hangs.

Before the phone would say "Sending text message"
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