> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/loadplugin_8h.md).

# loadplugin.h

[Data Structures](#nested-classes) | [Macros](#define-members) | [Enumerations](#enum-members) | [Functions](#func-members)

`#include <utility>` `#include <vector>` `#include <string>` `#include "`[sdiplugin.h](/adk-5.0-programmers-guide/sdiplugin_8h_source.md)`"` `#include "csd.h"` `#include "msr/msr.h"`

Include dependency graph for loadplugin.h:

![](/files/RJ0e6I3CE5jCGM0dJzFL)

This graph shows which files directly or indirectly include this file:

![](/files/zFrFrqLo14nh2JWsytuK)

[Go to the source code of this file.](/adk-5.0-programmers-guide/loadplugin_8h_source.md)

|                 |                                                                                       |
| --------------- | ------------------------------------------------------------------------------------- |
| Data Structures |                                                                                       |
| class           | [SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md) |
| struct          | [bcTriggerResult](#structbc_trigger_result)                                           |

|         |                                                                      |
| ------- | -------------------------------------------------------------------- |
| Macros  |                                                                      |
| #define | [VOS3\_CARDS\_PLUGIN\_ID](#a65d45de4ee2ba065a83d0d4b96b0fde4)   0xE1 |

|              |                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enumerations |                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| enum         | [TRIGGER\_TYPE](#a5bd4a8de2ccce074842d9df3509fe188) { [TRIGGER\_TYPE\_UNKNOWN](#a5bd4a8de2ccce074842d9df3509fe188a17e3e82af33f8125ebcad35b5c673d59), [TRIGGER\_TYPE\_SINGLE](#a5bd4a8de2ccce074842d9df3509fe188a77a3058745efb6d0b997a70a85ebec82), [TRIGGER\_TYPE\_MULTIPLE](#a5bd4a8de2ccce074842d9df3509fe188abb5670b3d143b240ab33a977c296f2a2), [TRIGGER\_TYPE\_SEQUENCIAL](#a5bd4a8de2ccce074842d9df3509fe188ae8224574671869771ebc746ee8e39cb3) } |
| enum         | [PLUGIN\_READ\_TYPE](#a87d5b69b03a93be2f94ede88b3675e79) { [PLUGIN\_READ\_NONE](#a87d5b69b03a93be2f94ede88b3675e79af9f39d0a4daadbd9ab293e28651d94a1), [PLUGIN\_READ\_FIRST](#a87d5b69b03a93be2f94ede88b3675e79a0aa41ba4fbff30ac457cbdb815e35d01), [PLUGIN\_READ\_NEXT](#a87d5b69b03a93be2f94ede88b3675e79a5ec9c0b384babec5670c5b48f212f18e) }                                                                                                         |

|                                                                                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Functions                                                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| const std::vector< [SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md) \* > & | [loadPlugins](#a601aff18c62cdfb15e1a16f1c66dbbb8) (bool reload=true)                                                                                                                                                                                                                                                                                                                                                                                   |
| const std::vector< [SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md) \* > & | [getLoadedPlugins](#a96e2ea2dbce448fb41986aa2ee19eba6) ()                                                                                                                                                                                                                                                                                                                                                                                              |
| void                                                                                                            | [registerPlugin](#a9d5f8efae300809ef2582ef2d30b8d38) ([SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md) \*p)                                                                                                                                                                                                                                                                                                       |
| [SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md) \*                        | [unregisterPlugin](#ad6bac1f9779d250bb674c1c1e481fc50) (const std::string \&filename)                                                                                                                                                                                                                                                                                                                                                                  |
| [SDIPlugin](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin.md) \*                               | [getPlugin](#a206221de659eaea0b9c26cfcb96bc049) (int pluginID)                                                                                                                                                                                                                                                                                                                                                                                         |
| void                                                                                                            | [handlePluginCmd](#aedeb718f16bf12b0642776c0f92cb209) (unsigned short msgBufSize, unsigned char \*msg, unsigned short msgSize, unsigned short rspBufSize, unsigned char \*rsp, unsigned short \*rspSize)                                                                                                                                                                                                                                               |
| int                                                                                                             | [executeSequencialTrigger](#ac3f6ed9f939661a29c9a91ccb603e767) ([SDIPlugin::SDITrigger](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin.md#a82c0da164c73dfba432f58136b1d3dab) triggerID, [PLUGIN\_READ\_TYPE](#a87d5b69b03a93be2f94ede88b3675e79) readType, unsigned char \*msg, unsigned short msgSize, unsigned short resBufSize, unsigned char \*res, unsigned short \*resSize)                                                      |
| void                                                                                                            | [storePluginMsrData](#aeba42accf97dbdbf6607ca2abec9e83b) ([MSR\_TrackData4](/adk-5.0-programmers-guide/readme/files/dir_b259c67979486db4cd1816234700c14a/dir_699851f087f6e6136e28f04fc8a16e7d/msr__common_8h.md#struct_m_s_r___track_data4) \&tracks, [MSR\_DecodedData4](/adk-5.0-programmers-guide/readme/files/dir_b259c67979486db4cd1816234700c14a/dir_699851f087f6e6136e28f04fc8a16e7d/msr__common_8h.md#struct_m_s_r___decoded_data4) \&decoded) |
| void                                                                                                            | [broadcastTriggerLocal](#a0f6f1985e988673c82d9285abbb6d1f8) ([SDIPlugin::SDITrigger](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin.md#a82c0da164c73dfba432f58136b1d3dab) triggerID, csd::csd\_data \&message, std::vector< struct [bcTriggerResult](#structbc_trigger_result) > \&results)                                                                                                                                            |
| void                                                                                                            | [broadcastTrigger](#abbbc773d285da350f8a32e81f0233650) ([SDIPlugin::SDITrigger](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin.md#a82c0da164c73dfba432f58136b1d3dab) triggerID, csd::csd\_data \&message, std::vector< struct [bcTriggerResult](#structbc_trigger_result) > \&results)                                                                                                                                                 |
| int                                                                                                             | [executeSingleTrigger](#abe54f620b7267559920a8f6f8f0c3705) ([SDIPlugin::SDITrigger](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin.md#a82c0da164c73dfba432f58136b1d3dab) triggerID, unsigned char \*msg, unsigned short msgSize, unsigned short resBufSize, unsigned char \*res, unsigned short \*resSize)                                                                                                                             |
| [SDIPlugin](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin.md) \*                               | [pluginInstalledForTrigger](#a4a24ab51f8a1f35a6d9b09fdc4639f4a) ([SDIPlugin::SDITrigger](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin.md#a82c0da164c73dfba432f58136b1d3dab) triggerID)                                                                                                                                                                                                                                               |

***

### DataStructure Documentation <a href="#data-structure-documentation" id="data-structure-documentation"></a>

### bcTriggerResult <a href="#structbc_trigger_result" id="structbc_trigger_result"></a>

struct bcTriggerResult

structure used by [broadcastTrigger()](/adk-5.0-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/loadplugin_8cpp.md#a0f98b5c2f8e38daf732d4a7403c9e898) to store a result for one plugin

|             |        |                                                     |
| ----------- | ------ | --------------------------------------------------- |
| Data Fields |        |                                                     |
| int         | id     | id of the plugin, which has returned the result     |
| string      | name   | name of the plugin, which has returned the result   |
| Buffer      | result | result buffer returned by processTrigger() function |
| int         | retval | return value of processTrigger() function           |

### MacroDefinition Documentation <a href="#macro-definition-documentation" id="macro-definition-documentation"></a>

### VOS3\_CARDS\_PLUGIN\_ID <a href="#a65d45de4ee2ba065a83d0d4b96b0fde4" id="a65d45de4ee2ba065a83d0d4b96b0fde4"></a>

\#define VOS3\_CARDS\_PLUGIN\_ID   0xE1

### EnumerationType Documentation <a href="#enumeration-type-documentation" id="enumeration-type-documentation"></a>

### PLUGIN\_READ\_TYPE <a href="#a87d5b69b03a93be2f94ede88b3675e79" id="a87d5b69b03a93be2f94ede88b3675e79"></a>

enum \[PLUGIN\_READ\_TYPE]\(#a87d5b69b03a93be2f94ede88b3675e79)

|                     |   |
| ------------------- | - |
| Enumerator          |   |
| PLUGIN\_READ\_NONE  |   |
| PLUGIN\_READ\_FIRST |   |
| PLUGIN\_READ\_NEXT  |   |

### TRIGGER\_TYPE <a href="#a5bd4a8de2ccce074842d9df3509fe188" id="a5bd4a8de2ccce074842d9df3509fe188"></a>

enum \[TRIGGER\_TYPE]\(#a5bd4a8de2ccce074842d9df3509fe188)

|                           |   |
| ------------------------- | - |
| Enumerator                |   |
| TRIGGER\_TYPE\_UNKNOWN    |   |
| TRIGGER\_TYPE\_SINGLE     |   |
| TRIGGER\_TYPE\_MULTIPLE   |   |
| TRIGGER\_TYPE\_SEQUENCIAL |   |

### FunctionDocumentation <a href="#function-documentation" id="function-documentation"></a>

### broadcastTrigger() <a href="#abbbc773d285da350f8a32e81f0233650" id="abbbc773d285da350f8a32e81f0233650"></a>

void broadcastTrigger

checks all loaded plugins for implemented trigger `triggerID`. If the trigger is implemented, the plugin function processTrigger() with the `triggerID` and the `message` is invoked. The results of all plugins, which supports the trigger is stored in vector `results`. This structure takes the return value of the the processTrigger() call and the result buffer of this function. In addition, the plugin name is stored so that the caller knows, which plugin has returned which result.

**Parameters**

\[in] **triggerID** trigger ID, for which processTrigger() is called on the loaded plugins, which support the trigger \[in] **message** message buffer passed to processTrigger() invoked on the plugins, which support the trigger. \[out] **results** vector containing result data for each processTrigger call (see struct bcTriggerResult)

### broadcastTriggerLocal() <a href="#a0f6f1985e988673c82d9285abbb6d1f8" id="a0f6f1985e988673c82d9285abbb6d1f8"></a>

void broadcastTriggerLocal

### executeSequencialTrigger() <a href="#ac3f6ed9f939661a29c9a91ccb603e767" id="ac3f6ed9f939661a29c9a91ccb603e767"></a>

int executeSequencialTrigger

### executeSingleTrigger() <a href="#abe54f620b7267559920a8f6f8f0c3705" id="abe54f620b7267559920a8f6f8f0c3705"></a>

int executeSingleTrigger

### getLoadedPlugins() <a href="#a96e2ea2dbce448fb41986aa2ee19eba6" id="a96e2ea2dbce448fb41986aa2ee19eba6"></a>

const std::vector\\<[SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md) \\\*\\>& getLoadedPlugins

return the list of loaded and registered SDI plugins

#### Returns

list of loaded and registered SDI plugins as vector (storing instances of class [SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md))

### getPlugin() <a href="#a206221de659eaea0b9c26cfcb96bc049" id="a206221de659eaea0b9c26cfcb96bc049"></a>

[SDIPlugin](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin.md)\\\* getPlugin

### handlePluginCmd() <a href="#aedeb718f16bf12b0642776c0f92cb209" id="aedeb718f16bf12b0642776c0f92cb209"></a>

void handlePluginCmd

### loadPlugins() <a href="#a601aff18c62cdfb15e1a16f1c66dbbb8" id="a601aff18c62cdfb15e1a16f1c66dbbb8"></a>

const std::vector\\<[SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md) \\\*\\>& loadPlugins

loads the SDI plugins from the SDI plugin folders and register them to the list of loaded SDI plugins. SDI plugin folders are the following:

1. Internal home lib directory
2. External plugin directory (Android only).

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>If a plugin in external plugin directory is found and has the same name as an plugin from home lib directory, the external plugin is preferred.</p></div>

   If mode flag \`reload\` is set true (default), all plugins are loaded or reloaded. If the flag is set to false, only the those plugins are loaded, which are not yet registered in the list of loaded SDI plugins. \*\*Parameters\*\*

   \[in] **reload** set to true (default), to unload already registered plugins, before they get loaded

   #### Returns

   list of loaded and registered SDI plugins as vector (storing instances of class [SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md))

### pluginInstalledForTrigger() <a href="#a4a24ab51f8a1f35a6d9b09fdc4639f4a" id="a4a24ab51f8a1f35a6d9b09fdc4639f4a"></a>

[SDIPlugin](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin.md)\\\* pluginInstalledForTrigger

checks for installed/loaded plugins, which support a specific trigger specified by `triggerID`.

**Parameters**

\[in] **triggerID** trigger ID to check plugins, if the trigger is supported

#### Returns

poniter to the first found plugin object if there is at least one plugin, which supports trigger `triggerID`, else false.

### registerPlugin() <a href="#a9d5f8efae300809ef2582ef2d30b8d38" id="a9d5f8efae300809ef2582ef2d30b8d38"></a>

void registerPlugin

register a loaded plugin to the list of SDI plugins. If the plugin is not valid or not loaded, this function does nothing. If a plugin with the same plugin file name, was already registered, the old plugin is unregistered and unloaded, before the new plugin is added.

**Parameters**

\[in] **p** new plugin to register in list of loaded SDI plugins

### storePluginMsrData() <a href="#aeba42accf97dbdbf6607ca2abec9e83b" id="aeba42accf97dbdbf6607ca2abec9e83b"></a>

void storePluginMsrData

### unregisterPlugin() <a href="#ad6bac1f9779d250bb674c1c1e481fc50" id="ad6bac1f9779d250bb674c1c1e481fc50"></a>

[SDIPluginCtx](/adk-5.0-programmers-guide/readme/annotated/class_s_d_i_plugin_ctx.md)\\\* unregisterPlugin

unregister a loaded plugin from the list of loaded SDI plugins. If the plugin is found according its filename (without path) the pointer to the unregistered SDI plugin context is returned.

**Parameters**

\[in] **filename** name of the plugin shared object (without path), Example: "libsdiplugin-myplugin.so"

#### Returns

pointer to the SDI plugin context (if found), else NULL

{% hint style="info" %}
The plugin is not unloaded, after it was successfully unregistered. The caller must invoke delete on the returned object to free its resources.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/loadplugin_8h.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
