#include <glib.h>
#include <dlog.h>
#include <gio/gio.h>
-#include <dlfcn.h>
#include "bluetooth-api.h"
#include "bt-service-common.h"
static int assigned_id;
static gboolean req_id_used[BT_REQUEST_ID_RANGE_MAX];
-bt_plugin_info_t *headed_plugin_info = NULL;
-
void _bt_init_request_id(void)
{
assigned_id = 0;
- memset(req_id_used, 0x00, sizeof(req_id_used));
+ memset(req_id_used, 0x00, BT_REQUEST_ID_RANGE_MAX);
}
int _bt_assign_request_id(void)
}
}
-void bluetooth_plugin_init()
-{
- headed_plugin_info = g_malloc0(sizeof(bt_plugin_info_t));
- if (!headed_plugin_info) {
- BT_ERR("Can not memory alloc headed plugin");
- return;
- }
-
- /* check ARCH 64 or 32*/
- if (!access(FILEPATH_ARCH_64, 0)) {
- BT_INFO("plugin loading for ARCH 64");
- headed_plugin_info->handle_headed = dlopen(HEADED_PLUGIN_FILEPATH64, RTLD_NOW);
- } else {
- BT_INFO("plugin loading for ARCH 32");
- headed_plugin_info->handle_headed = dlopen(HEADED_PLUGIN_FILEPATH, RTLD_NOW);
- }
-
- if (!headed_plugin_info->handle_headed) {
- BT_ERR("Can not load plugin %s", dlerror());
- headed_plugin_info->plugin_headed_enabled = FALSE;
- return;
- }
-
- headed_plugin_info->headed_plugin = dlsym(headed_plugin_info->handle_headed, "headed_plugin");
- if (!headed_plugin_info->headed_plugin) {
- BT_ERR("Can not load symbol : %s", dlerror());
- dlclose(headed_plugin_info->handle_headed);
- headed_plugin_info->plugin_headed_enabled = FALSE;
- return;
- }
-
- headed_plugin_info->plugin_headed_enabled = TRUE;
- BT_INFO("Bluetooth Headed Plugin Initialized");
-}
-
-void bluetooth_plugin_deinit()
-{
- BT_INFO("Bluetooth Headed Plugin Deintialized");
- if (!headed_plugin_info->plugin_headed_enabled) {
- g_free(headed_plugin_info);
- headed_plugin_info = NULL;
- return;
- }
-
- dlclose(headed_plugin_info->handle_headed);
- headed_plugin_info->plugin_headed_enabled = FALSE;
- g_free(headed_plugin_info);
- headed_plugin_info = NULL;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-