mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
miracle-wifid: change managed property of link by method call instead of
set property due to wpa_supplicant needs time to get ready
This commit is contained in:
parent
3558c4e511
commit
0677d64252
5 changed files with 89 additions and 59 deletions
|
@ -170,22 +170,30 @@ int link_set_managed(struct link *l, bool set)
|
|||
return 0;
|
||||
|
||||
if (set) {
|
||||
log_info("manage link %s", l->ifname);
|
||||
|
||||
r = supplicant_start(l->s);
|
||||
if (r < 0) {
|
||||
log_error("cannot start supplicant on %s", l->ifname);
|
||||
return -EFAULT;
|
||||
}
|
||||
log_info("acquiring link ownership %s", l->ifname);
|
||||
} else {
|
||||
log_info("link %s no longer managed", l->ifname);
|
||||
log_info("droping link ownership %s", l->ifname);
|
||||
supplicant_stop(l->s);
|
||||
}
|
||||
|
||||
l->managed = set;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void link_supplicant_managed(struct link *l)
|
||||
{
|
||||
if(l->managed) {
|
||||
return;
|
||||
}
|
||||
|
||||
l->managed = true;
|
||||
link_dbus_properties_changed(l, "Managed", NULL);
|
||||
}
|
||||
|
||||
int link_renamed(struct link *l, const char *ifname)
|
||||
{
|
||||
char *t;
|
||||
|
@ -338,6 +346,9 @@ void link_supplicant_stopped(struct link *l)
|
|||
if (!l || !l->public)
|
||||
return;
|
||||
|
||||
l->managed = false;
|
||||
link_dbus_properties_changed(l, "Managed", NULL);
|
||||
|
||||
log_info("link %s unmanaged", l->ifname);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue