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-17
Sets the UART interface.
BOOL uart_setmode(int port, int mode);
Inputs:
<port> the serial port number.
<mode> the interface parameter.
0 : RS-232
1 : RS485-2W
2 : RS422
3 : RS485-4W
Return Values:
TRUE indicates success, FALSE indicates failed.
Remark:
For example, user uart_getmode(2) to retrieve the interface of COM2:
DIO
Opens a DIO handle for later use.
HANDLE mxdio_init(void);
Inputs:
none
Return Values:
pointer to a DIO handle. Return 0 on failure.
Remark:
Every DIO API needs the handle parameter, so you must use the function first before you program
them.
Closes the DIO handle.
void mxdio_stop(HANDLE hDIO);
Inputs:
<hDIO> the DIO handle
Return Values:
None
Remark:
Sets one of the DOUT outputs.
int mxdio_set_dout(HANDLE hDIO, unsigned int port, unsigned int data);
Inputs:
<hDIO> the DIO handle
<port> the port index, from 0 to 3 mapping to DO0~DO3
<data> 1: HIGH, 0: LOW
Return Values:
0 on success, otherwise, the function fails
Remark: