The fsVarsAVarBufferGet function can be used to get the value of a specific AVar stored as an abstract buffer (including strings and LLA / PBH vectors).

Syntax
FsVarError fsVarsAVarBufferGet(
    FsAVarId aVarId,
    FsUnitId unitId,
    FsVarParamArray param,
    void* buffer,
    int bufferSize,
    FsObjectId target
);
Parameters
ParametersDescription
aVarIdThe ID of an AVar (found using fsVarsGetAVarId).
unitIdThe ID of a unit (found using fsVarsGetUnitId).
paramA parameter which might be mandatory to access the AVar (in the case of an indexed AVar, for example). Elements in param can be FsCrc, String or index.
bufferThe buffer that will receive the value of the AVar if the other parameters are correct.
bufferSizeThe size of the given buffer in bytes.
targetThe ID of the object from which the variable is being retrieved. Default: FS_OBJECT_ID_USER_AIRCRAFT.
Return Values

The function returns a FsVarError, where 0 means there is no error (in which case, the value of the AVar has been copied to buffer).

Remarks

If the given buffer is smaller than the size of the AVar, only the first bufferSize bytes will be copied in the buffer.

Example
FsUnitId unitId = fsVarsGetUnitId("String");
FsAVarId aVarId = fsVarsGetAVarId("ATC AIRLINE");
char buffer[128];
buffer[0] = '\0';
if (fsVarsAVarBufferGet(aVarId, unitId, {}, buffer, sizeof(buffer), FS_OBJECT_ID_USER_AIRCRAFT) == FS_VAR_ERROR_NONE)
{
    // valid
}
else
{
    // error
}

0/255