The fsVarsGetBVarId function can be used to get the FsBVarId of a specific BVar using its name and its preset.

 

Syntax
FsBVarId fsVarsGetBVarId(
    const char* bVarName,
    bool callable,
    FsObjectId target
);

 

Parameters
ParametersDescription
bVarName

The name of the BVar and optionally its preset ("name[_preset]").

callableA boolean indicating if the BVar can be called.
target

The ID of the object from which the variable is being retrieved.

 

Return Values

The function returns the correct ID associated to the given name. If an error occurred, the function will return FS_VAR_INVALID_ID.

 

Example
FsBVarId BVarId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT", false); // valid in DA62
FsBVarId BVarId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT", true); // NOT valid in DA62, this preset is not callable
FsBVarId BVarId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT_TOGGLE", false); // valid in DA62
FsBVarId BVarId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT_TOGGLE", true); // valid in DA62
FsBVarId BVarId = fsVarsGetAVarId("toto"); // NOT valid in DA62, doesn't exists