/* TODO: Need to check this operation!! */
if (powered == FALSE) {
DBG("###### Adapter Powered Down ######");
+ DBG("Pending disalbed event after bluetoothd is terminated");
+#if 0
+ /* We should send the disable event for USB dongle type's target in here. So remain thie code */
+
struct hal_ev_adapter_state_changed ev;
ev.state = HAL_POWER_OFF;
event_cb(HAL_EV_ADAPTER_STATE_CHANGED, &ev, sizeof(ev));
#endif
/* Destroy Agent */
_bt_hal_destroy_adapter_agent();
+#endif
} else {
DBG("###### Adapter Powered Up ######");
if (_bt_hal_get_adapter_request_state()) {
return FALSE;
if (strcasecmp(name, BT_HAL_BLUEZ_NAME) == 0) {
+ struct hal_ev_adapter_state_changed ev;
+ struct hal_ev_le_state_changed le_ev;
+
DBG("Bluetoothd is terminated");
- /* TODO: Handle Bluetoothd terminating scenario */
+ /* Send the disable event in here */
+
+ ev.state = HAL_POWER_OFF;
+ le_ev.state = HAL_POWER_OFF;
+
+ event_cb(HAL_EV_ADAPTER_STATE_CHANGED, &ev, sizeof(ev));
+ event_cb(HAL_EV_LE_STATE_CHANGED, &le_ev, sizeof(le_ev));
+
+ /* Destroy Agent */
+ _bt_hal_destroy_adapter_agent();
_bt_hal_le_deinit();
}
} else if (g_strcmp0(param->interface_name, BT_HAL_PROPERTIES_INTERFACE) == 0) {