X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-oal%2Foal-manager.c;h=7ae3e67658deb8fd6c15b2568825ad30eca8e3a8;hb=b8332fffa713f8043d21379ab4df4d34dad6f6ff;hp=83a4ab5df48c0da044d61ba111e6e341ef1079de;hpb=8c224b5acf80594efa1f49ac94a5bacd46c8d493;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-oal/oal-manager.c b/bt-oal/oal-manager.c index 83a4ab5..7ae3e67 100644 --- a/bt-oal/oal-manager.c +++ b/bt-oal/oal-manager.c @@ -44,6 +44,7 @@ static const hw_module_t* module = NULL; static const bt_interface_t *blued_api = NULL; +static bluetooth_device_t* bt_device = NULL; static gboolean unload_libs(gpointer data); static bluetooth_device_t* load_hal_lib(void); @@ -53,8 +54,6 @@ static int unload(const struct hw_module_t *module); oal_status_t oal_mgr_init_internal(void) { - bluetooth_device_t* bt_device; - bt_device = load_hal_lib(); if (bt_device == NULL) { @@ -84,8 +83,12 @@ oal_status_t oal_bt_init(oal_event_callback cb) void oal_bt_deinit(void) { BT_INFO("+"); - blued_api->cleanup(); - blued_api = NULL; + if (blued_api) { + blued_api->cleanup(); + blued_api = NULL; + } + _bt_event_dispatcher_deinit(); + sleep(1); unload_libs(NULL); BT_INFO("-"); } @@ -124,6 +127,7 @@ gboolean oal_lib_init(gpointer data) static gboolean unload_libs(gpointer data) { + bt_device->common.close((hw_device_t*)bt_device); unload((hw_module_t const*)module); module = NULL; return FALSE; @@ -133,7 +137,6 @@ static bluetooth_device_t* load_hal_lib(void) { int err = 0; hw_device_t* device; - bluetooth_device_t* bt_device = NULL; BT_DBG("Loading HAL lib"); if (module == NULL) { @@ -259,3 +262,8 @@ gboolean oal_get_debug_mode(void) /*TODO Unsupported */ return FALSE; } + +const char *oal_get_stack_name(void) +{ + return module ? module->name : NULL; +}