-
- /// get custom library names to load
- if(get_custom_libraries() >= 0)
- {
- // initialize custom library structure
- for(i = 0; i < PersCustomLib_LastEntry; i++)
- {
- invalidate_custom_plugin(i);
- }
-
- for(i=0; i < PersCustomLib_LastEntry; i++ )
- {
- if(check_valid_idx(i) != -1)
- {
- if(getCustomLoadingType(i) == LoadType_PclInit) // check if the plugin must be loaded on plc init
- {
- if(load_custom_library(i, &gPersCustomFuncs[i] ) == 1)
- {
- PersInitType_e initType = getCustomInitType(i);
- if(initType == Init_Synchronous)
- {
- if( (gPersCustomFuncs[i].custom_plugin_init) != NULL)
- {
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary => plugin: "), DLT_STRING(get_custom_client_lib_name(i)));
- gPersCustomFuncs[i].custom_plugin_init();
- }
- else
- {
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => E r r o r could not load plugin functions: "),
- DLT_STRING(get_custom_client_lib_name(i)));
- }
- }
- else if(initType == Init_Asynchronous)
- {
- if( (gPersCustomFuncs[i].custom_plugin_init_async) != NULL)
- {
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary => plugin: "), DLT_STRING(get_custom_client_lib_name(i)));
- gPersCustomFuncs[i].custom_plugin_init_async(customAsyncInitClbk);
- }
- else
- {
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => E r r o r could not load plugin functions: "),
- DLT_STRING(get_custom_client_lib_name(i)));
- }
- }
- else
- {
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => E r r o r unknown init type "), DLT_STRING(get_custom_client_lib_name(i)));
- }
- }
- else
- {
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => E r r o r could not load plugin: "),
- DLT_STRING(get_custom_client_lib_name(i)));
- }
- }
- }
- else
- {
- continue;
- }
- }
- }
- else