If, after 5 times (which is 1s), wpa_supplicant is still not reachable, we
now drop the link. This avoids hangup issues during wpas startup that
might happen from time to time.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
If miracled is spawned with --manage-wifi, we run our own copy of
wpa_supplicant on managed devices. This is meant for testing purposes
only. Hopefully, network-manages like NM or connman will provide a P2P API
at some time so we can switch. Until then, we allow the user to control
who is in charge of wpa_supplicant.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Allow users to tag devices as "miracle" via udev so they get picked up
automatically. We also add a generic "remove"-monitor so we correctly drop
links as they get unplugged. The wpa_supplicant notification is unreliable
so we want the proper udev-events here.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
We should notify miraclectl about ScanStopped events so we can correctly
track active scans. If we don't do that, we would have to explicitly track
it on connect/disconnect/etc. commands, which seems cumbersome given the
undeterminisc actions they cause.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Hook up the peer-dbus API with the underlying peer objects. This allows to
handle incoming requests and deal with connection issues.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Both dbus commands allow external programs to make our device discoverable
for P2P devices and also start scanning for remote devices.
The commands are *not* ref-counted right now, so parallel use is
discouraged. However, these commands can interrupt normal operations on a
wifi-device anyway, so if used in parallel, it is very like to break.
Thus, keep the interface simple and require callers to do
access-management (it's root-only, anyway..).
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Send ObjectManager.Interfaces{Added,Removed} signals whenever new objects
appear. Note that we cannot set DBus interfaces there as sd-bus ignores
them. We'll try to fix that upstream and until then just not expose any of
those.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
We need to send PropertiesChanged signals whenever we change properties
that are annotated as such.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Implement basic peer properties and hook them up with dbus. Also add a
device_name parser to the wifi implementation so we correctly read the
friendly-name of remote devices.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
The friendly-name is used as name for local links. Default to a random
string and try to read the local hostname during startup.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This initial commit contains the main "miracled" daemon that does
link-management and peer-discovery/control. The "miraclectl" tool can be
used to control this daemon during runtime.
Note that this implementation is still missing a lot of stuff. All it
currently does is provide link-management and basic peer-discovery.
Following commits will hook everything else up.
The actual Miracast/Wifi-Display related runtime control is not being
worked on, yet. Feel free to use the proof-of-concept from the OpenWFD
repository. The MiracleCast implementation will not get any such
functionality unless the basic link-management is properly working.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>