From X-Plane SDK
Jump to: navigation, search


XPLM_API void                 XPLMGetNavAidInfo(
                                   XPLMNavRef           inRef,    
                                   XPLMNavType *        outType,    /* Can be NULL */
                                   float *              outLatitude,    /* Can be NULL */
                                   float *              outLongitude,    /* Can be NULL */
                                   float *              outHeight,    /* Can be NULL */
                                   int *                outFrequency,    /* Can be NULL */
                                   float *              outHeading,    /* Can be NULL */
                                   char *               outID,    /* Can be NULL */
                                   char *               outName,    /* Can be NULL */
                                   char *               outReg);    /* Can be NULL */

This routine returns information about a navaid. Any non-null field is filled out with information if it is available.

Frequencies are in the nav.dat convention as described in the X-Plane nav database FAQ: NDB frequencies are exact, all others are multiplied by 100.

The buffer for IDs should be at least 6 chars and the buffer for names should be at least 41 chars, but since these values are likely to go up, I recommend passing at least 32 chars for IDs and 256 chars for names when possible.

The outReg parameter tells if the navaid is within the local "region" of loaded DSFs. (This information may not be particularly useful to plugins.) The parameter is a single byte value 1 for true or 0 for false, not a C string.

When looking at a glideslope beacon, the heading field is actually two values encoded into one float. The slope of the glideslope is multiplied by 100,000 (the earth_nav.dat specification states that the factor is 10,000 instead, but this is wrong) then added to the heading that the glideslope points. As an example, a glideslope of 2.83 degrees above horizontal, with a heading of 089.4 degrees True will return an outHeading of 283089.400... See the earth_nav.dat spec, pg 6 for more info.