Moxa W406-T-LX [69/74] W315a 325a linux user s manual programmer s guide

Moxa W406-T-CE [69/74] W315a 325a linux user s manual programmer s guide
W315A/325A Linux User's Manual Programmer's Guide
6-10
int cellular_modem_sms_recv_message(unsigned int fd, int index, unsigned int msg_mode,
SMSMSG *psms);
Description: Receives an indexed SMS message.
Input: <fd> the cellular modem
<index> the index to the message pool
<msg_mode> 0: message in text; 1: message in PDU
<psms> pointer to the message
Return Value: 0 on success; otherwise, the function has failed
Remarks:
#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;
To use PDU mode to receive your SMS message, you must destruct the “SMSMSG.msg_text” field to extract
the message body.
int cellular_modem_sms_delete_message(unsigned int fd, int index);
Description: Deletes an indexed SMS message.
Input: <fd> the cellular modem
<index> the index to the message pool
Return Value: 0 if successful; other numbers indicate that the function failed
int cellular_modem_sim_get_sim_card_status(unsigned int fd);
Description: Gets the SIM card status.
Input: <fd> the cellular modem
Return Value: 0: ready, okay to use
1: no sim card (or loose)
2: PIN, wait for the pin code for authentication
3: PUK, incorrect pin code was entered 3 times
other numbers: indicates that the function has failed
int cellular_modem_sim_get_pin_attempt_count(unsigned int fd);
Description: When the SIM card status is set to PIN (2), this function retrieves the available PIN code
attempt count. I
f the SIM card status is set to PUK (3), this function gets the available PUK
code attempt count.
Input: <fd> the cellular modem
Return Value: The attempted count left of PIN/PUK code authentication; a negative number indicates a
failure
int cellular_modem_sim_authenticate_pin_code(unsigned int fd, char *pin_code);
Description: When the SIM card status is set to PIN (2), this function authenticates a PIN code. If the
correct code is entered the status will be set back to ready (0).
Input: <fd> the cellular modem
<pin_code> pointer to the PIN code
Return Value: 0 if successful; other numbers indicate that the function failed

Содержание

Скачать