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);
oal_status_t oal_mgr_init_internal(void)
{
- bluetooth_device_t* bt_device;
-
bt_device = load_hal_lib();
if (bt_device == NULL) {
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);
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;
{
int err = 0;
hw_device_t* device;
- bluetooth_device_t* bt_device = NULL;
BT_DBG("Loading HAL lib");
if (module == NULL) {
/*TODO Unsupported */
return FALSE;
}
+
+const char *oal_get_stack_name(void)
+{
+ return module ? module->name : NULL;
+}