If we don't split peer linking off, the peer might get advertised before
the sub-device related data is set. With dbus, this might trigger
callbacks to not return attributes as the peer-type is unknown. Therefore,
properly initialize the peer before linking/advertising it.
This fixes a bug where the initial InterfacesAdded signal for new peers
does not include all properties of a peer.
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>
This command prints detailed information on a given peer. This is exactly
the same as 'show-link' but for peers.
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>
Move peer_make_name() to the top to keep consistency with miracled-link.c
and move non-object-based helpers to the top.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
The new show-link command lists detailed information of a given link.
Useful for debugging and introspection.
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>