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-13
Gets the storage base of SIM messages.
int cellular_modem_sms_get_storage_base(unsigned int fd);
Inputs:
<fd> the cellular modem
Return Values:
0: on SIM card, 1: on modem module, 2: on both, otherwise, the function fails
Remark:
Gets the number of stored messages allowed out of the maximum space.
int cellular_modem_sms_get_message_count(unsigned int fd, int *maximum);
Inputs:
<fd> the cellular modem
Outputs:
<maximum> pointer to the maximum number of messages allowed
Return Values:
The number of stored messages, otherwise, a negative value indicates a failure
Remark:
Sends a SMS message to a specific phone number.
int cellular
_
modem
_
sms
_
send
_
messa
g
e(unsi
g
ned int fd, unsi
g
ned int ms
g_
mode, SMSMS
G
*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”.