gsmGetAntennaMode (Function)

Top  Previous  Next

Architecture:

X32 / NX32

Device support:

SX1, AX9i, AX9 turbo/encore

Firmware version:

4.40


This function returns which antenna is used, and the current selection mode set by the gsmSetAntennaMode function.

 

 

Input:

None.

 

Output:

mode : SINT

1

The internal antenna is selected.

2

The external antenna is selected.

3

AX9i/AX9 turbo/encore: The active antenna is determined by DIP-switch 4.

 

active : SINT

1

The internal antenna is active.

2

The external antenna is active.

 

Returns: INT

0

Not supported

1

Successful.

 

 

Declaration:

FUNCTION gsmGetAntennaMode : INT;
VAR_INPUT
  mode   : ACCESS SINT;
  active : ACCESS SINT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  mode : SINT;
  used : SINT;

  str : STRING;
END_VAR;
 
BEGIN
  ...

  IF gsmGetAntennaMode(mode := mode, active := used) = 0 THEN

     str := "GSM Antenna: Not supported";

  ELSE

     str := "GSM Antenna: ";

    CASE mode OF

        1: str := str + "mode=Internal";

        2: str := str + "mode=External";

        3: str := str + "mode=Dip switch";

    END_CASE;

    CASE used OF

        1: str := str + ", used=Internal";

        2: str := str + ", used=External";

    END_CASE;

  END_IF;

  DebugMsg(message := str);

  ...
END;
END_PROGRAM;