W406-CE User’s Manual
Application Development
Sends a SMS message to a specific phone number.
int cellular_modem_sms_send_message(unsigned int fd, unsigned int msg_mode, SMSMSG
*psms);
Inputs:
<fd> the cellular modem
<msg_mode> 0: message in text, 1: message in PDU
<psms> point to the message
Return Values:
0 on success, otherwise, the function fails
Remark:
#define MAX_SMS_BYTES
512
typedef struct _SMSMSG
{
unsigned
int been_read;
char
msg_date[12];
char
msg_time[20];
char
phone_number[20];
unsigned int msg_length;
char
msg_text[MAX_SMS_BYTES];
} SMSMSG, *PSMSMSG;
If you like to use PDU mode to send your SMS message, you must construct your PDU data into
the “SMSMSG.msg_text” field with exact length “SMSMSG.msg_length”.
Receives an indexed SMS message.
int cellular_modem_sms_recv_message(unsigned int fd, int index, unsigned int msg_mode,
SMSMSG *psms);
Inputs:
<fd> the cellular modem
<index> the index to the message pool
<msg_mode> 0: message in text, 1: message in PDU
<psms> point to the message
Return Values:
0 on success, otherwise, the function fails
Remark:
#define MAX_SMS_BYTES
512
typedef struct _SMSMSG
{
unsigned
int been_read;
char
msg_date[12];
char
msg_time[20];
char
phone_number[20];
unsigned int msg_length;
char
msg_text[MAX_SMS_BYTES];
} SMSMSG, *PSMSMSG;
If you like to use PDU mode to receive your SMS message, you must destruct the
“SMSMSG.msg_text” field to extract the message body.
B-5