1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

miracle-wifid: add Link.P2PState for checking P2P supporting status

This commit is contained in:
Derek Dai 2017-04-01 10:00:13 +08:00
parent ed490f181b
commit aa499be0dc
No known key found for this signature in database
GPG key ID: E109CC97553EF009
4 changed files with 64 additions and 1 deletions

View file

@ -155,6 +155,26 @@ bool link_is_using_dev(struct link *l)
return l->use_dev;
}
int link_get_p2p_state(struct link *l)
{
return l->p2p_state;
}
int link_set_p2p_state(struct link *l, int state)
{
if (!l)
return log_EINVAL();
if (l->p2p_state == state)
return 0;
if(-1 > state || 1 < state)
return log_EINVAL();
l->p2p_state = state;
link_dbus_properties_changed(l, "P2PState", NULL);
return 0;
}
bool link_get_managed(struct link *l)
{
return l->managed;
@ -184,6 +204,19 @@ int link_set_managed(struct link *l, bool set)
return 0;
}
void link_supplicant_p2p_state_known(struct link *l, int state)
{
if (!l)
return log_vEINVAL();
if (l->p2p_state == state)
return;
if(-1 > state || 1 < state)
return log_vEINVAL();
l->p2p_state = state;
link_dbus_properties_changed(l, "P2PState", NULL);
}
void link_supplicant_managed(struct link *l)
{
if(l->managed) {