}
}
+void unload_sdbd_service_plugin()
+{
+ if ( plugin_cmd_hashtable ) {
+ hashtable_destroy ( plugin_cmd_hashtable );
+ plugin_cmd_hashtable = NULL;
+ }
+
+ if ( g_plugin_handle ) {
+ dlclose ( g_plugin_handle );
+ g_plugin_handle = NULL;
+ }
+}
+
// return 1 if plugin support given command
// return 0 if plugin does not support given command
int is_supported_by_plugin ( int cmd )
out->number_of_parameter = 0;
out->array_of_parameter = NULL;
-
if ( plugin_cmd_hashtable ) {
ret = hashtable_get ( plugin_cmd_hashtable, cmd, &pr );
if ( ret == 1 ) {
ret = default_plugin_sync_proc ( cmd, in, out );
}
} else {
+ E("Plugin Command HashTable Does Not Exist");
ret = default_plugin_sync_proc ( cmd, in, out );
}
return ret;
}
+
static void request_async_cmd ( int cmd, parameters* in, int out_fd )
{
int ret, pr;
unload_sdbd_plugin();
}
+static void sdb_service_cleanup(void)
+{
+ unload_sdbd_service_plugin();
+}
+
+
void start_device_log(void)
{
int fd;
void sdb_main_service()
{
+ load_sdbd_plugin();
init_capabilities();
init_sdk_requirements();
+ atexit(sdb_service_cleanup);
}
int copy_packet(apacket* dest, apacket* src) {