User`s manual

Table Of Contents
W406-LX Linux User’s Manual Programmer’s Guide
6-11
Closes a cellular modem handle.
void cellular_modem_close(unsigned int fd);
Inputs:
<fd> the handle
Return Values:
None
Remark:
You must release the cellular modem handle resource if you don’t need to use cellular modem
APIs later.
Sends an AT command to a cellular modem and waits for a reply.
int cellular_modem_send_cmd(unsigned int fd, char *at_cmd, char *recv, int recv_size, int
timeout);
Inputs:
<fd> the cellular modem
<at_cmd> the AT command
<recv_size> maximum size of the buffer that stores replied data
<timeout> timeout in milliseconds if no response.
Outpus:
<recv> point to buffer that stores the reply
Return Values:
the number of received data, -1 indicates failure.
Remark:
Generally, you can set the timeout to be 1000~2000 milliseconds, but if you call the function with
“AT^SMGL=ALL” command. We suggest you set the timeout greater than 10000, because listing
all of the SMS messages requires more time.
Gets the signal strength of the GPRS modem.
int cellular_modem_gprs_get_signal_strength(unsigned int fd);
Inputs:
<fd> the cellular modem
Outpus:
<recv> point to buffer that stores the reply
Return Values:
1 to 99 on success, otherwise the function fails
Remark:
It is suggested to call this function periodically.
Establishes a GPRS connection to the ISP service provider.
int cellular_modem_gprs_establish_connection(unsigned int fd, char *user, char *password);
Inputs:
<fd> the cellular modem
<user> point to the user id, null indicates empty userid.
<password> point to the user password, null indicates empty password.
Return Values:
0 on success, otherwise, the function fails
Remark: