SimConnect_RequestFacilityData
The SimConnect_RequestFacilityData function is used to request data according to a predefined object, an ICAO and a region.
Syntax
HRESULT SimConnect_RequestFacilityData(
HANDLE hSimConnect,
SIMCONNECT_DATA_DEFINITION_ID DefineID,
SIMCONNECT_DATA_REQUEST_ID RequestID,
const char * ICAO,
const char * Region = ""
);
Parameters
Parameter | Description | Type |
---|---|---|
hSimConnect |
Handle to a SimConnect object. | Integer |
DefineID |
Specifies the ID of the client defined data definition | |
RequestID |
The client defined request ID | |
ICAO |
Used to identify an airport, a VOR, an NDB or a waypoint. | |
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). |
Return Values
The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return value | Description |
---|---|
S_OK |
The function succeeded. |
E_FAIL |
The function failed. |
SIMCONNECT_EXCEPTION_UNRECOGNIZED_ID |
The function has an invalid DefineId . |
SIMCONNECT_EXCEPTION_ERROR |
The 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 a list of possibilities (ICAO + Region) - using the SIMCONNECT_RECV_FACILITY_MINIMAL_LIST
structure - and then you can make the request again, including the region as well as the ICAO. Alternatively, you can use the SimConnect_RequestFacilityData_EX1
function which permits you to specificy a route point "Type" and only get the data that correspond to that specific point type.
See Also
- SimConnect API Reference
- SimConnect_AddToFacilityDefinition
- SimConnect_RequestFacilitiesList
- SimConnect_RequestFacilityData_EX1