1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-12 22:11:58 +00:00
Commit graph

164 commits

Author SHA1 Message Date
David Herrmann
837fe1cea1 miracled: split peer allocation and linking
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>
2014-02-10 18:27:21 +01:00
David Herrmann
e60e678d40 miracled: implement Start/StopScan
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>
2014-02-10 16:56:59 +01:00
David Herrmann
8bcf3348e8 miracled: implement InterfacesAdded/Removed
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>
2014-02-10 16:29:02 +01:00
David Herrmann
5d5ab7761f miracled: implement PropertiesChanged signals
We need to send PropertiesChanged signals whenever we change properties
that are annotated as such.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-02-10 15:57:02 +01:00
David Herrmann
14ca5829b2 miraclectl: add 'show-peer' verb
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>
2014-02-10 14:59:16 +01:00
David Herrmann
fde71e7352 miracled: implement peer properties
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>
2014-02-10 14:58:32 +01:00
David Herrmann
7457a7cf90 miracled: move peer_make_name() definition
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>
2014-02-10 14:22:33 +01:00
David Herrmann
4879057c01 miraclectl: add 80-char marker
Add a marker with 80-char width so the help text will get proper sizes.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-02-10 14:14:19 +01:00
David Herrmann
d26892b61f miraclectl: add 'set-link-name' verb
The new set-link-name command allows users to change the friendly-name of
a given link.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-02-10 14:14:19 +01:00
David Herrmann
a765bd29b8 miraclectl: add 'show-link' verb
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>
2014-02-10 14:14:19 +01:00
David Herrmann
27a74298e9 miracle: add few bus helpers
Two new bus helpers to deal with common sd-bus tasks.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-02-10 14:14:19 +01:00
David Herrmann
2e50d006ad miracled: friendly-name support for local links
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>
2014-02-10 12:58:24 +01:00
David Herrmann
062c73ecf3 miracled: move link_make_name() declaration
Make the header consistent and move independent helpers above the real
object handling.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-02-10 12:15:05 +01:00
David Herrmann
051b584746 Initial MiracleCast Implementation
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>
2014-02-09 18:36:06 +01:00