|
bladox.com Turbo SIM Toolkit Adapter Forums
|
View previous topic :: View next topic |
Author |
Message |
rhamel Guest
|
Posted: Sun Jul 30, 2006 2:05 pm Post subject: Ok, so what am I doing wrong here? |
|
|
I'm hoping somebody can help me out here. This piece of code is supposed to send an SMS when I press a button. The SMS is sent and received by the target phone, but the message itself is garbled. I'm thinking that it gets converted to something over than text to be transmitted, or maybe I don't know what I'm talking about??
Can you point out what I'm doing wrong, please?
Richard
-------------------------------------------------------------
code starts here
-------------------------------------------------------------
#include <config.h>
#include <turbo/turbo.h>
#include <stdlib.h>
#include <string.h>
u8 PROGMEM msg[] = "MESSAGE HERE!"; // SMS Message
u8 PROGMEM phonenum[] = "5551234" ; // phone number
void action_sms (void *data)
{
// allocate space for SMS text
u8 *tmp = malloc (100);
// convert string to phone number that cellphone understands
u8 *fone = str2msisdn (phonenum, MSISDN_ADN, MEM_R);
// copy the SMS message to the text buffer
memcpy (tmp, msg, sizeof (msg));
// send the SMS message
send_sms (tmp, sizeof (msg), fone, MSISDN_ADN, 0xF1, 0, NULL, NULL);
free (tmp);
free (fone);
}
void turbo_handler (u8 action, void *data)
{
switch (action)
{
case ACTION_INSERT_MENU:
insert_menu ("SEND SMS");
break;
case ACTION_MENU_SELECTION:
stk_thread (action_sms, NULL);
break;
default:
break;
}
} |
|
Back to top |
|
|
pz Guest
|
Posted: Sun Jul 30, 2006 2:15 pm Post subject: |
|
|
Why DCS is 0xF1? Try 0xF6. F1 is 7 bit packed, default alphabet. |
|
Back to top |
|
|
|
|
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
|