gsmSelectSIM (Function)

Top  Previous  Next

Architecture:

NX32 / NX32L

Device support:

MX2 turbo/encore/warp, NX-200, LX2

Firmware version:

4.00 / 1.40.00


This function selects which SIM card to use on devices with multiple SIM card readers.

The selected SIM card reader is persistent over resets until set again by the function or from the RTCU IDE in the configuration dialog.

 

If called with the currently selected SIM card reader, the function returns immediately, without affecting the GSM connection.

When changing the SIM card while the GSM modem is powered on, the entire GSM stack is restarted, causing any active calls, mobile network connections etc. to terminate. Once the GSM connection has been re-established using the new SIM card, mobile network the RTCU Communication Hub connection will be automatically reestablished.

If the GSM modem is not powered on, the selection will be stored, and used when the GSM modem is powered on next time.

 

 

Input:

mode : SINT

1

Internal SIM card reader.

2

External SIM card reader.

 

Returns:

0

Success.

1

Illegal mode.

2

Internal SIM card reader is not enabled.

3

SIM card reader is not present.

 

Declaration:

FUNCTION gsmSelectSIM : INT;
VAR_INPUT
  mode : SINT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
...
 
// Select internal SIM card reader
gsmSelectSIM(mode := 1); // Needs only to be set once
 
...
 
END_PROGRAM;