User`s manual
Table Of Contents
- 1. Introduction
- 2. Getting Started
- Powering on the W406-LX
- Connecting the W406-LX to a PC
- Configuring the Ethernet Interface
- USB Port for Expansion
- SD Socket for Storage Expansion
- Setting Up the Wireless Module
- Configuring the SIM Card
- Entering the PIN Code
- Verifying the SIM Card Status
- Enabling or Disabling the PIN Code Authentication
- Changing the PIN Code
- Unlocking the SIM Card
- Connecting to the Internet
- Reconnecting to the Internet
- Disconnecting from the Internet
- Detecting an Internet Connection Error
- Sending and Reading an SMS Message
- Deleting an SMS Message
- Test Program—Developing Hello.c
- 3. Managing Embedded Linux
- 4. Managing Communications
- 5. Development Tool Chains
- 6. Programmer’s Guide
- 7. Software Lock
- A. System Commands

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: