20 #include <config_test.h> 27 static void fmi2logger(fmi2_component_environment_t env, fmi2_string_t instanceName,
fmi2_status_t status, fmi2_string_t category, fmi2_string_t message, ...)
32 va_start(argp, message);
44 const char* modelIdentifier;
45 const char* modelName;
61 printf(
"Error parsing XML, exiting\n");
62 return (CTEST_RETURN_FAIL);
67 printf(
"Model name: %s\n", modelName);
70 printf(
"Model identifier for ME: %s\n", modelIdentifier);
75 printf(
"Model identifier for CS: %s\n", modelIdentifier);
79 printf(
"Unxepected FMU kind, exiting\n");
80 return (CTEST_RETURN_FAIL);
82 printf(
"Model GUID: %s\n", GUID);
86 printf(
"Could not create the DLL loading mechanism(C-API).\n");
87 return(CTEST_RETURN_FAIL);
96 return (CTEST_RETURN_SUCCESS);
fmi2_step_finished_ft stepFinished
fmi2_callback_allocate_memory_ft allocateMemory
FMILIB_EXPORT const char * fmi2_import_get_version(fmi2_import_t *fmu)
Wrapper for the FMI function fmiGetVersion()
FMILIB_EXPORT fmi2_import_t * fmi2_import_parse_xml(fmi_import_context_t *context, const char *dirPath, fmi2_xml_callbacks_t *xml_callbacks)
Create fmi2_import_t structure and parse the FMI 2.0 XML file found in the directory dirName...
int fmi2_test(fmi_import_context_t *context, const char *dirPath)
FMILIB_EXPORT const char * fmi2_import_get_model_name(fmi2_import_t *fmu)
Get model name.
FMILIB_EXPORT fmi2_fmu_kind_enu_t fmi2_import_get_fmu_kind(fmi2_import_t *fmu)
Get the type of the FMU (model exchange or co-simulation)
static void stepFinished(fmi2_component_environment_t env, fmi2_status_t status)
FMILIB_EXPORT void fmi2_import_destroy_dllfmu(fmi2_import_t *fmu)
Free a C-API struct. All memory allocated since the struct was created is freed.
fmi2_callback_logger_ft logger
Include file to be used in client applications of the FMI Library.
FMILIB_EXPORT const char * fmi2_import_get_model_identifier_CS(fmi2_import_t *fmu)
Get model identifier for CoSimulation.
fmi2_callback_free_memory_ft freeMemory
fmi2_fmu_kind_enu_t
FMU 2.0 kinds.
fmi2_component_environment_t componentEnvironment
FMILIB_EXPORT jm_status_enu_t fmi2_import_create_dllfmu(fmi2_import_t *fmu, fmi2_fmu_kind_enu_t fmuKind, const fmi2_callback_functions_t *callBackFunctions)
Create a C-API struct. The C-API struct is a placeholder for the FMI DLL functions.
static void fmi2logger(fmi2_component_environment_t env, fmi2_string_t instanceName, fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...)
FMILIB_EXPORT const char * fmi2_status_to_string(fmi2_status_t status)
struct fmi_xml_context_t fmi_import_context_t
FMI version independent library context. Opaque struct returned from fmi_import_allocate_context() ...
FMILIB_EXPORT void fmi2_import_free(fmi2_import_t *fmu)
Release the memory allocated.
FMILIB_EXPORT const char * fmi2_import_get_GUID(fmi2_import_t *fmu)
Get FMU GUID.
jm_status_enu_t
Return status codes.
FMILIB_EXPORT const char * fmi2_import_get_model_identifier_ME(fmi2_import_t *fmu)
Get model identifier for ModelExchange.
struct fmi2_import_t fmi2_import_t
FMU version 2.0 object.
FMILIB_EXPORT int jm_vsnprintf(char *str, size_t size, const char *fmt, va_list al)
C89 compatible implementation of C99 vsnprintf.