View previous topic :: View next topic |
Author |
Message |
johnsecret
Joined: 04 Sep 2010 Posts: 20
|
Posted: Fri Sep 10, 2010 4:37 pm Post subject: Sending SS commands |
|
|
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 |
|
 |
johnsecret
Joined: 04 Sep 2010 Posts: 20
|
Posted: Sat Sep 11, 2010 12:12 pm Post subject: |
|
|
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 |
|
 |
pz Guest
|
Posted: Wed Sep 15, 2010 10:38 am Post subject: |
|
|
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
|
Posted: Thu Sep 16, 2010 8:22 am Post subject: |
|
|
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
|
Posted: Thu Sep 16, 2010 8:55 am Post subject: |
|
|
It worked perfectly! Many thanks
now on to AT commands  |
|
Back to top |
|
 |
johnsecret
Joined: 04 Sep 2010 Posts: 20
|
Posted: Thu Sep 16, 2010 10:51 am Post subject: |
|
|
I am screaming quietly here - Do you have a function that will do the ascii to MSISDN format conversion?
thanks |
|
Back to top |
|
 |
johnsecret
Joined: 04 Sep 2010 Posts: 20
|
Posted: Fri Sep 17, 2010 4:23 pm Post subject: |
|
|
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 |
|
 |
|