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 

Sending SS 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: Fri Sep 10, 2010 4:37 pm    Post subject: Sending SS commands Reply with quote

I am trying to send an SS command to the network. I get a "sending a request" message, but the SS command (in this case a divert) does not activate. I can only suppose it is something to do with the way I am preparing it, as the SS command is valid. Code below:

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

u8 PROGMEM t_Foo_en[] = "DIVERTED";
u8 PROGMEM t_Text_ss[]="*21*phonenumberhere#";

void deflect (void *data)
{
u8 *buf = buf_A ();
u8 len = 0;
u8 i;
u8 *response;
buf[len++] = T_SS_STRING | CR_FLAG;
buf[len++] = strlen(t_Text_ss);
for (i = 0; i < strlen(t_Text_ss); i++)
buf[len++] = rb(t_Text_ss+i);
stk_cmd (STK_CMD_SEND_SS, 0x00, DEV_ID_NETWORK, len);
display_text_raw (t_Text_ss, Q_DISPLAY_TEXT_HIGH_PRIORITY);
}


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



Joined: 04 Sep 2010
Posts: 20

PostPosted: Sat Sep 11, 2010 12:12 pm    Post subject: Reply with quote

OK, so I read a bit more, and see I'm not converting the string to 7 bit

I tried something very simple: I set up unconditional voice divert, and then tried to cancel it with

u8 PROGMEM t_Text_ss[]={0x23,0x59,0x6C,0x04};

in my previous code - I now get a brief "Wait" message, and then nothing

I'm really stuck - Is there anyone out there? I don't feel I'm getting true value from my purchase!

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





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

I don't have the 11.14 specs but check the SS string notation, maybe it's like a msisdn - swapped nibbles, not ascii.
Back to top
pz
Guest





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

So it has to be coded as msisdn, e.g.
u8 PROGMEM t_ss_no_21[] = { 0xff, 0xbb, 0x12, 0xfb}; // ##21#
Back to top
johnsecret



Joined: 04 Sep 2010
Posts: 20

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

It worked perfectly! Many thanks

now on to AT commands Smile
Back to top
View user's profile Send private message
johnsecret



Joined: 04 Sep 2010
Posts: 20

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

I am screaming quietly here - Do you have a function that will do the ascii to MSISDN format conversion?

thanks
Back to top
View user's profile Send private message
johnsecret



Joined: 04 Sep 2010
Posts: 20

PostPosted: Fri Sep 17, 2010 4:23 pm    Post subject: Reply with quote

GOT IT!

For the benefit of anyone else who needs it.

The string is a) BCD packed, and b) made up of decimal semi-octets

Confused?

BCD is a way of representing decimal numbers. The key here is that "*" is 'a' and "#" is 'b'

So the number ##21# is bb21b

But, you have to make up your decimal semi octals.

If you have an odd number of characters, you add an "f" at the end

Hence:

bb21bf

Then you swap the pairs:

bb12fb

And for good measure, you seem to stick "ff" on the front end, which gives you the string earlier in the thread.

Hope that helps someone else
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