gsmSelectSIM (Function)

Top  Previous  Next

Architecture:

NX32 / NX32L

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 M2M Studio in the configuration dialog.

 

When the SIM card selection function is called with the reader that is currently active, it returns immediately without affecting the existing cellular connection. If the active SIM card is changed while the cellular modem is powered on, the entire cellular stack is forced to restart, which terminates all active voice calls and data sessions. Once the cellular connection is successfully re-established using the new SIM card, the network and the RTCU Communication Hub connection will be automatically restored. In cases where the cellular modem is not powered on during the selection, the new configuration is stored and will be applied the next time the modem is initialized.

 

 

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;