mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-01 16:14:22 +08:00
Add btd_adapter_switch_online for turning on adapters
This commit is contained in:
parent
c8e88ab534
commit
aa9aeceabd
@ -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)
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user