User`s manual

Table Of Contents
W406-LX Linux User’s Manual Programmer’s Guide
6-14
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.
Deletes an indexed SMS message.
int cellular_modem_sms_delete_message(unsigned int fd, int index);
Inputs:
<fd> the cellular modem
<index> the index to the message pool
Return Values:
0 on success, otherwise, the function fails
Remark:
Gets the SIM card status.
int cellular_modem_sim_get_sim_card_status(unsigned int fd);
Inputs:
<fd> the cellular modem
Return Values:
0 : ready, okay to use
1 : no sim card, (or loose)
2 : PIN, wait for the pin code for authentication
3 : PUK, three times of wrong pin codes
otherwise, the function fails
Remark: