The SimConnect_RequestFacilityData_EX1 function is used to request data according to a predefined object, an ICAO and a region. This function is practically identical in functionality to the SimConnect_RequestFacilityData function, only it has an additional return value used to identify waypoints when there is an ICAO/Region overlap with VOR or NDB.

 

Syntax
HRESULT SimConnect_RequestFacilityData(
    HANDLE hSimConnect,
    SIMCONNECT_DATA_DEFINITION_ID DefineID,
    SIMCONNECT_DATA_REQUEST_ID RequestID,
    const char * ICAO,
    const char * Region = "",
    char Type = 0
    );

 

Parameters
ParameterDescriptionType
hSimConnectHandle to a SimConnect object.Integer
DefineIDSpecifies the ID of the client defined data definitionInteger
RequestIDThe client defined request IDInteger
ICAOUsed to identify an airport, a VOR, an NDB or a waypoint.Char
Region

Additional identifier for an airport, a VOR, an NDB or a waypoint. For airports, this can be omitted without issue, however for VOR / NDB / Waypoints this should be supplied if possible, although there are workarounds provided if it's not (see remarks, below).

Char
Type

Additional identifier for when requesting data to differentciate between waypoint/VOR/NDB when there are overlapping ICAO/Region identifiers. Should be one of the following ASCii values:

  1. 86 ('V') - VOR
  2. 78 ('N') - NDB
  3. 87 ('W') - Waypoint
Char

 

Return Values

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return valueDescription
S_OKThe function succeeded.
E_FAILThe function failed.
SIMCONNECT_EXCEPTION_UNRECOGNIZED_IDThe function has an invalid DefineId.
SIMCONNECT_EXCEPTION_ERRORThe function was supplied an invalid ICAO and/or Region parameter.

 

Remarks

If the Request works, the client will receive as many messages (SIMCONNECT_RECV_FACILITY_DATA) as necessary to match the defined architecture. At the end, the server will send a SIMCONNECT_RECV_FACILITY_DATA_END message to let the client know that everything is finished. For an example of use and more information, please see SimConnect_AddToFacilityDefinition.

 

Note that it is possible to request a Waypoint/NDB/VOR using only the ICAO and no region. When doing so, if there is no duplicated ICAO, then the appropriate data will be returned. However, if there is a conflict between multiple ICAO’s, the function will return only those that correspond to the given “Type”.

 

See Also