Moxa ioPAC 8020-9-RJ45-C-T [32/66] Mx_cellular_modem_init

Moxa ioPAC 8020-9-RJ45-C-T [32/66] Mx_cellular_modem_init
Developer's Guide for Moxa RTU Controllers Programmer's Guide
2-24
MX_Cellular_Modem_Init
INT32 MX_Cellular_Modem_Init(INT8 *pin, UINT32 band);
Init cellular library; users should invoke this initial function before calling any other cellular API function
. On
success, the API state will be changed to READY from INIT.
Input Parameters
Pin
PIN code of the SIM card (a 4-byte string). If the PIN is empty, use NULL.
Band
Enable/disable the frequency band of the cellular modem.
#define MODEM_BAND_HC25_GSM900 1
#define MODEM_BAND_HC25_GSM1800 2
#define MODEM_BAND_HC25_GSM850 4
#define MODEM_BAND_HC25_GSM1900 8
#define MODEM_BAND_HC25_WCDMA2100 16
#define MODEM_BAND_HC25_WCDMA1900 32
#define MODEM_BAND_HC25_WCDMA8500 64
#define MODEM_BAND_HC25_AUTO 127
Return Value
Returns MODEM_ERR_OK on success. Refer to the returned code table for return values when an error occurs.
Notes
ioLogik W5348-C series only
MX_Cellular_Net_Start
INT32 MX_Cellular_Net_Start(INT8 *apn, INT8 *userName, INT8 *password, CheckInfo*
autoCheck);
Once the initialization is done and the state is MODEM_STATE_READY, users can use this function to establish
a cellular connection with Auto Reconnect in Enabled mode or Disabled mode. If Auto Reconnect is enabled,
the cellular API will check the cellular connection status periodically and re-establish the cellular connection
when the cellular connection is down. If Auto Reconnect is disabled, users should define and check the cellul
ar
status manually with their program. On success, the API state will be changed from READY to CONNECTING.
Once a cellular connection is established, the state will be changed from CONNECTING to CONNECTED. If any
errors occur while establishing the cellular connection, the state will be changed to DISCONNECTED. If Auto
Reconnect is disabled, users should monitor the state with a program and call this function to re-establish the
cellular connection.
Input Parameters
APN
Access point name; should follow the data plan/package
UserName
The user’s name; should follow the data plan/package
Password
The password; should follow the data plan/package
AutoCheck
autoCheck:
autoCheck autoCheckEnable: 0:disabled, 1:enable Auto Reconnect mode
autoCheck pingHostname: The IP or the host name of a public server, if
autoCheckEnable==1, the cellular API will ping to that server periodically to check the
status of the cellular connection.
autoCheck pingIntervalS: the interval time in seconds for detecting the mote host or a
public server.
autoCheck pingMaxFail: If the ping timeout occurs successively more times than this
settings, the cellular API will re-establish the cellular connection.
Return Value
Returns MODEM_ERR_OK on success. Refer to the returned code table for return values when an error occurs.
Notes
ioLogik W5348-C series only

Содержание

Скачать