Add btd_adapter_switch_online for turning on adapters

This commit is contained in:
Daniel Orstadius 2010-07-09 10:37:27 +03:00 committed by Luiz Augusto von Dentz
parent c8e88ab534
commit aa9aeceabd
2 changed files with 12 additions and 0 deletions

View File

@ -3259,6 +3259,17 @@ int btd_adapter_restore_powered(struct btd_adapter *adapter)
return adapter_ops->set_powered(adapter->dev_id, TRUE);
}
int btd_adapter_switch_online(struct btd_adapter *adapter)
{
if (!adapter_ops)
return -EINVAL;
if (adapter->up)
return 0;
return adapter_ops->set_powered(adapter->dev_id, TRUE);
}
int btd_adapter_switch_offline(struct btd_adapter *adapter)
{
if (!adapter_ops)

View File

@ -163,6 +163,7 @@ gboolean adapter_is_pairable(struct btd_adapter *adapter);
gboolean adapter_powering_down(struct btd_adapter *adapter);
int btd_adapter_restore_powered(struct btd_adapter *adapter);
int btd_adapter_switch_online(struct btd_adapter *adapter);
int btd_adapter_switch_offline(struct btd_adapter *adapter);
struct btd_adapter_ops {