Skip to content

Commit

Permalink
Merge pull request #2 from fledge-iot/1.8.0RC
Browse files Browse the repository at this point in the history
1.8.0 rc
  • Loading branch information
YashTatkondawar authored May 15, 2020
2 parents e6f0c38 + 82169e0 commit ab5f59b
Show file tree
Hide file tree
Showing 11 changed files with 854 additions and 18 deletions.
33 changes: 33 additions & 0 deletions C/services/common/delivery_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ DeliveryPlugin::DeliveryPlugin(const std::string& name,
manager->resolveSymbol(handle,
"plugin_reconfigure");

pluginStartPtr = (void (*)(PLUGIN_HANDLE))
manager->resolveSymbol(handle,
"plugin_start");

// Persist data initialised
m_plugin_data = NULL;

Expand Down Expand Up @@ -154,3 +158,32 @@ void DeliveryPlugin::setEnabled(const ConfigCategory& config)
m_enabled);
}
}

/**
* Call plugin_start
*/
void DeliveryPlugin::start()
{
if (pluginStartPtr != NULL)
{
this->pluginStartPtr(m_instance);
}
}

/**
* Register service
*
* @param func The function to call
* @param data First argument to pass to above function
*/
void DeliveryPlugin::registerService(void *func, void *data)
{
void (*pluginRegisterService)(PLUGIN_HANDLE, void *, void *) =
(void (*)(PLUGIN_HANDLE, void *, void *))
manager->resolveSymbol(handle, "plugin_registerService");

if (pluginRegisterService != NULL)
{
(*pluginRegisterService)(m_instance, func, data);
}
}
Loading

0 comments on commit ab5f59b

Please sign in to comment.