This function is used to get a bit mask of the currently enabled positioning systems.
Before calling this function the GNSS receiver must be turned ON by a call to gpsPower() or gpsPowerLP.
This can be used to check if the systems enabled using gnssEnableType actually have been enabled.
As some GNSS receivers do not support all possible combinations of positioning systems, it may require that multiple systems are enabled or disabled before the currently enabled systems change.
Input:
None
Returns: INT
>0
|
- Bit mask of enabled positioning systems:
Bit
|
System
|
0
|
GPS
|
1
|
GLONASS
|
2
|
GALILEO
|
3
|
BeiDou
|
|
0
|
- Not supported or no positioning systems are enabled.
|
-1
|
- GNSS module not powered or not supported.
|
-2
|
- Invalid parameter. system might not be supported on this device.
|
-3
|
- Error performing action.
|
Declaration:
FUNCTION gnssGetEnabledSystems : INT;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
rc : INT;
END_VAR
gpsPower(power := ON);
rc := gnssGetEnabledSystems();
IF rc < 0 THEN
DebugFmt(message:="gnssGetEnabledSystems failed: \1", v1:=rc);
ELSE
IF rc AND (1 <> 0) THEN
DebugMsg(message:="GPS");
END_IF;
IF rc AND (2 <> 0) THEN
DebugMsg(message:="GLONASS");
END_IF;
IF rc AND (4 <> 0) THEN
DebugMsg(message:="Galileo");
END_IF;
IF rc AND (8 <> 0) THEN
DebugMsg(message:="BeiDou");
END_IF;
END_IF;
BEGIN
...
END;
END_PROGRAM;
|