gsmSIMPresent (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.00 / 1.00.00


This determines whether the SIM card is present

 

Notice:
On RTCU devices without a physical card detect mechanism, the actual detection of the SIM card is performed in the power-on phase when calling gsmPower. When calling gsmSIMPresent without a former power-on with gsmPower, the SIM card detection will take extended time. It is therefore recommended to turn the GSM module on before calling gsmSIMPresent.

 

For devices with multiple SIM card readers the status of the currently selected reader will be returned. See gsmSelectSIM().

 

 

 

Input:

None.

 

Returns: BOOL

TRUE:

The SIM card is present.

FALSE:

The SIM card is not present.

 

Declaration:

FUNCTION gsmSIMPresent : BOOL;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
  // Check for successful connection to a GSM base station
  IF gsmConnected() THEN
     // RTCU is connected to a base station
     ...
  ELSE
     // RTCU is NOT connected to a base station
    IF gsmSIMPresent() THEN
        // SIM card is inserted
        ...
    ELSE
        // No SIM card in device
        ...
    END_IF;
  END_IF;
END;
 
END_PROGRAM;