Downgrading required CMake VERSION to 3.0
This is related with #7. it's okay to downgrade (not specific version is needed) but cmake was not working anyway.
miraclecast depends on gstreamer an a bunch of its plugins to show
screen mirrored. This script provides a test to confirm everything
needed is installed, and suggest another way to show streamed
source if its needed plugins are not available.
Devices sometimes report sessions followed by ";timeout=..". Cut this off.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Properly notify API users if we free peers that are pending. This way,
they don't have to use timers to restart peer discovery on wpa_supplicant
failures.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
If there is already a connection pending, don't start a new one.
Unfortunately, wpa_supplicant is unable to deal with this so we have to
enforce this.. Yuck!
We also reset the pending state during P2P_FIND now, this enables API
users to reset failed connections that wpa_supplicant was unable to close
(yeah, beacuse it's so hard to write proper APIs.. *sigh*).
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
No need to add 'display' to p2p_connect commands. Drop it for future
compatibility.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
P2P-PEER reports the device name as 'device_name' while P2P-DEVICE-FOUND
reports it as 'name'. Try both.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Forward the --audio and --scale arguments to our gst-spawn helper and
parse them via bash for now.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
The sinkctl tool is currently a hack to make Miracast sinks work. The
embedded gst-launch invocation is kinda ugly to handle. Move it into a
bash-script so we can experiment a bit more with different pipelines.
Ultimatively, the goal is obviously to make this work as its own gst
element.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
We now use the pkg-config snippet of libsystemd, so no need to add
host-local include paths, anymore.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
We require libsystemd, not libsystemd-daemon. Fix the pkg-config test and
also adjust the version.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
rtsp_message_readv() is a convenience function. If one of the values to be
read fails, it does not restore the previous situation. Therefore, handle
that in sinkctl in case we cannot read a value.
Reported-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
ether_ntoa() function used in DHCP server skips leading zeros so
reformat is needed to make strcmp() work for mac-comparisons.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Don't skip leading zeroes for MAC addresses. Some software cannot handle
this well.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Copy over recent changes to gdhcp from ConnMan. We should really start
exporting sd-dhcp from libsystemd so we can finally drop this alltogether.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
p->sp->sta_mac is not mandatory set so check it before accessing it.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
M6 M7 messages should use URL from wfd_presentation_URL of M4. Parse it
during set_parameter and use it in further requests instead of a
hard-coded URL.
Signed-off-by: Andrey Gusakov <adnrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
In M7 message session ID should be included. Session ID is returned in M6
response. So we should wait for M6 response.
Signed-off-by: Andrey Gusakov <adnrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
As it turns out, the C standard forbids passing va_list by value and then
continue using it in the parent function (C Standard, 7.16, paragraph 3).
Luckily, there's a footnote stating:
"It is permitted to create a pointer to a va_list and pass that
pointer to another function, in which case the original function may
take further use of the original list after the other function
returns."
Therefore, we're safe passing va_list by reference and thus can keep the
current coding style.
This fixes weird bugs on ARM32 which really doesn't allow passing va_list
by value.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Forward group-formation-failure events via dbus so sinkctl can restart
p2p-scans immediately. Unfortunately, the event itself does not contain
any useful information at all. Therefore, we have to track the connection
attempts ourselves.
Signed-off-by: Andrey Gusakov <adnrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
sd_bus never uses 'bool', and given the weird implicit type promotions, it
is totally right to do so. Make sure we never pass pointers to 'bool' to
va_arg sd_bus functions to avoid overwriting stack space.
Signed-off-by: Andrey Gusakov <adnrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
The libsystemd-bus API changed recently. Update our calls to use the new
API so it compiles with newer systemd versions.
Signed-off-by: Andrey Gusakov <adnrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>