gsmGetNetworkType (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

4.00 / 1.00.00


This returns whether there is a 2G, 3G or 4G(LTE) connection established to the cellular network.

 

Input:

None.

 

Returns: INT

0

- Not connected / unknown.

2

- 2G

3

- 3G

4

- 4G (LTE)

 

Declaration:

FUNCTION gsmGetNetworkType : INT;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
// The next code will only be executed once after the program starts
gsmPower(power:=TRUE);
 
// Wait until GSM module registered on network
WHILE NOT gsmConnected() DO Sleep(delay:=1000); END_WHILE;
 
DebugFmt(message:="Network type = \1", v1 := gsmGetNetworkType());
 
BEGIN
 
END;
 
END_PROGRAM;