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 

Ok, so what am I doing wrong here?

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





PostPosted: Sun Jul 30, 2006 2:05 pm    Post subject: Ok, so what am I doing wrong here? Reply with quote

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





PostPosted: Sun Jul 30, 2006 2:15 pm    Post subject: Reply with quote

Why DCS is 0xF1? Try 0xF6. F1 is 7 bit packed, default alphabet.
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