1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-15 04:42:06 +00:00
Commit graph

295 commits

Author SHA1 Message Date
Derek Dai
fadcceabd8
add wfd_arg_list type of wfd_arg 2017-02-18 23:09:45 +08:00
Derek Dai
857cb11704
refactoring getter/setter for dict type of wfd_arg to remove declaration
of temp variable
2017-02-18 23:09:45 +08:00
Derek Dai
04886d862b
add support for signed and unsigned int for wfd_arg 2017-02-18 23:09:45 +08:00
Derek Dai
e020da4b24
rename macro arguement from v to _v to prevent name confliction 2017-02-18 23:09:45 +08:00
Derek Dai
d74d36a99e
miracle-wfdctl: remove unused function and improve log message for
peer new & delete
2017-02-18 23:09:44 +08:00
Derek Dai
750ff77929
miracle-*ctl: fix and enhance wfd_subelement parser 2017-02-18 23:09:44 +08:00
Derek Dai
495675cdd4
add struct wfd_arg to generalize passing of arguments 2017-02-18 23:09:40 +08:00
Derek Dai
21986b4cea
miracle-wfdctl: fix return uninitialized variable value issue 2017-02-17 16:06:02 +08:00
Derek Dai
34cc56dba8
miracle-wfdctl: run gst-launch to generate video stream with hardcoded
environment
2017-02-16 19:31:23 +08:00
Derek Dai
643b023225
miracle-wfdctl: add timeout value and Range header to the reply of PLAY request 2017-02-16 19:31:23 +08:00
Derek Dai
d4cdaf9bca
remove unused #include 2017-02-15 23:47:01 +08:00
Derek Dai
11016d9e03
remove unused files 2017-02-15 18:37:33 +08:00
Derek Dai
9dd805378e
miracle-wfdctl: finish migration of source side rtsp protocol 2017-02-15 18:19:16 +08:00
Derek Dai
3bcb8f51f6
miracle-*ctl: add *_from_string() and *_to_string() for wfd-video-formats and
wfd-audio-codecs
2017-02-15 12:30:43 +08:00
Derek Dai
761219d998
miracle-wfdctl: return -EINVAL instead of being aborted by assert() when
rtsp message ID is invalid
2017-02-14 14:50:49 +08:00
Derek Dai
6c55a332d2
miracle-wfdctl: refactoring to remove repeated snippets and centralize the
dispatching of request and reply
2017-02-14 14:22:49 +08:00
Derek Dai
81d735f7b9
miracle-wfdctl: now we can establish WFD session multiple times
in this revision, the source side RTSP protocol is not implemented
completely, the focus is on stability, DBus interfaces.
2017-02-13 13:12:56 +08:00
Derek Dai
63b5482681
miracle-*ctl: update links and peers when wifid up or down 2017-02-13 13:12:56 +08:00
Derek Dai
c590adbd2f
miracle-wfdctl: first revision which can create TCP connection of WFD session between peers, controled through DBus
In this revision, the procedure of session negotiation is not yet
completed but only TCP connection can be established between peers.

You can try it by run script `res/miracle-wfdctl-demo` to see how it
work.
2017-02-13 13:12:55 +08:00
Derek Dai
45e7fea3e5
miracle-srcctl: rename ctl_src to wfd_src 2017-02-13 13:12:55 +08:00
Derek Dai
00e1afc3e9
remove vim settings from files 2017-02-13 13:12:55 +08:00
Derek Dai
4d47aa4d53
miracle-*ctl: rename resolution_bitmap to wfd_resolution and add progressive field 2017-02-13 13:12:55 +08:00
Derek Dai
20b14da0b5
miracle-*ctl: remove N_ELEMENTS() and use SHL_ARRAY_LENGTH() instead 2017-02-13 13:12:55 +08:00
Derek Dai
8381290479
miracle-wifid: let the format of wfd_dev_info compliant with wfd_subelems to ease parsing 2017-02-13 13:12:55 +08:00
Derek Dai
7ea9305172
miracle-*ctl: fix label leak 2017-02-13 13:12:55 +08:00
Derek Dai
14041bd968
miracle-*ctl: resolve object parsing issue in ctl_wifi_fetch()
while parsing ctl_peer and ctl_link objects, if a ctl_peer appear prior
to its related ctl_link, -EINVAL is reported, and miracle-*ctl will quit
immediately.
2017-02-13 13:12:54 +08:00
Derek Dai
cfc98095d1
miracle-*ctl: remove some debugging log messages 2017-02-13 13:12:54 +08:00
Derek Dai
f47669a59b
miracle-wfdctl: init commit 2017-02-13 13:12:54 +08:00
Derek Dai
df336c8c51
miracle-wifid: add MACAddress property to link 2017-02-13 13:12:54 +08:00
Derek Dai
1919de3158
miracle-srcctl: fix some warming 2017-02-13 13:12:54 +08:00
Derek Dai
853152cb9c
miracle-wifid: remove duplicated link & peer dbus nodes by checking prefix 2017-02-13 13:12:54 +08:00
Xu Fasheng
7d7df75bc9
Make miracle-wifid conexists with other network tools
The new option --lazy-managed will let miracle-wifid don't managed the
links automatically. Instead, the link will be managed only when the new
DBus property Managed was set to true. So this will be possible that
miracle-wifid could be conexists with other network tools like
networkmanager.

For example, unmange the device in networkmanager with setting the DBus
property org.freedesktop.NetworkManager.Device.Managed to false and
manage it in miracle-wifid with setting
org.freedesktop.miracle.wifi.Link.Managed to true, then both them could
works and don't need to kill each other.

Besides, there is new command named make-managed in miracle-wifictl and
miracle-sinkctla.
2017-02-13 13:12:54 +08:00
Derek Dai
d239c528ff
miracle-srcctl: fix memory management issues 2017-02-13 13:12:54 +08:00
Derek Dai
20ff174fe8
stop sender properly after session end 2017-02-13 13:12:53 +08:00
Derek Dai
d8d538ef65
encode video with x264enc temperarily to prevent decoding issue on dongle 2017-02-13 13:12:53 +08:00
Derek Dai
03744ba53b
rename dbus name back to org.freedesktop.miracle.Sender and variety kinds of tunning 2017-02-13 13:12:53 +08:00
Derek Dai
91e1ee29ec
miracle-wifid: fix call waitid() with NULL pointer issue reported by valgrind 2017-02-13 13:12:53 +08:00
Derek Dai
eb5c563a8d
miracle-sender: change bus name from org.freedesktop.miracle.Sender to org.freedesktop.miracle 2017-02-13 13:12:53 +08:00
Derek Dai
21fc207d4c
miracle-wifid: fix some leaks of wpas_message 2017-02-13 13:12:53 +08:00
Derek Dai
b3b51120e0
source implement + sender talk via dbus 2017-02-13 13:12:53 +08:00
Derek Dai
fb37a53dec
stop sender when peer freed 2017-02-13 13:12:52 +08:00
Derek Dai
047775303b
integrate miracle-sender with miracast-srcctl 2017-02-13 13:12:52 +08:00
Derek Dai
8a935e1893
initial sender implementation 2017-02-13 13:12:52 +08:00
Derek Dai
5c501c0594
init source side implementation 2017-02-13 13:12:52 +08:00
Derek Dai
c76667cf71
match resolution from high to low 2017-02-13 13:12:52 +08:00
Derek Dai
b6d372eae4
calculate array size of resolutions at build time instead of tailing null element 2017-02-13 13:12:52 +08:00
Derek Dai
5f39158f45
init copy & modify 2017-02-13 13:12:52 +08:00
Derek Dai
2a3796cfe9
fix byte order of DHCP_SERVER_ID option
If miraclecat is GO, miracle-dhcp runs as server, it send out SERVER_ID
option in little endian, causes non-GO peer connect to wrong IP address, so
RTSP connection can't be established.

In scenario like, say Android (GO) <-> miracalcast (non-GO), the DHCP service
is provided by Android, in this case, the SERVER_ID is in expected byte order
(big endian).
2017-02-13 13:12:48 +08:00
Alberto Fanjul
e5795edd04 Read UIBC capability in raw mode
Some devices send its UIBC capabilities with spaces. Read in raw mode to parse port correctly
2016-10-28 11:37:16 +02:00
albfan
cedfeeebe1 Debug GStreamer execution
Allow to config gstreamer log level
2016-10-23 10:20:12 +02:00
albfan
472fbf4a24 Check source UIBC capability
If source has no UIBC capability don't try to connect UIBC controller,
and listen UIBC setting to disable UIBC

relates to #115
2016-10-23 09:46:02 +02:00
albfan
5e93ad0638 Fix compilation warnings 2016-10-23 04:27:17 +02:00
albfan
cd23da3c74 Fix finding subnet 2016-10-01 12:29:48 +02:00
Derek Dai
3886dcb7c7 add option --use-dev to miracle-wifid to workaround the 'no ifname' issue 2016-09-14 16:01:54 +08:00
Derek Dai
a9266e5055 re-dispatch wpa_message with ifname!=NULL from supplicant_global_fn() to supplicant_dev_fn() 2016-09-14 15:01:26 +08:00
Derek Dai
1cc667a00c don't modify raw message 2016-09-14 15:01:26 +08:00
albfan
36be37ed8b Fix wpa_supplicant search when path did not exists 2016-08-26 06:29:34 +02:00
Derek Dai
4601514799 find wpa_supplicant through PATH instead of option --wpa-bindir 2016-08-15 17:35:38 +08:00
Alberto Fanjul
7228c3e63d Change to support CI environment 2016-07-23 20:20:58 +02:00
albfan
412ce067b6 Use resolution provided to resize viewer 2016-07-23 19:15:38 +02:00
albfan
3f2266e254 Kill uibc viewer subprocess
closes #93
2016-07-16 15:29:13 +02:00
albfan
1e69dd6dae UIBC support
Basic support for UIBC (single mouse events and key events)

 - Option --uibc on miracle-sinkctl to enable it
 - Option --log-journal-level to see player execution on journalctl
 - Controller for uibc miracle-uibcctl
 - Player based on PyGtk to receive and communicate mouse and keyevents

closes #57
2016-07-02 15:47:15 +02:00
albfan
4637409d0b relay on PATH to find executables 2016-07-02 15:22:13 +02:00
albfan
c94be167c8 open UIBC connection
relates to #57
2016-04-02 13:15:38 +02:00
albfan
5440572335 Version 1.0 2016-01-24 20:54:40 +01:00
albfan
117ed2071b Parse text log level
closes #42
2015-08-30 14:53:12 +02:00
albfan
73adee82bf Select interface to use
Start miraclecast against interface of choose.

- By tagged udev device
- By `--interface` or `-i` option

resolves #36, resolves #43, resolves #46
2015-08-30 11:20:41 +02:00
albfan
0bf42867ad log wpa messages 2015-08-22 16:48:51 +02:00
albfan
781231db26 comment avaliable prov methods
Use only pbc method, but keep commented all available methods
2015-08-22 12:18:46 +02:00
albfan
81e71c8387 ignored wpa events
relates to #37
2015-07-29 20:33:27 +02:00
albfan
80aefc1611 config udev tag
relates to #36
2015-07-29 20:27:51 +02:00
albfan
30459133ed prov type for default config 2015-07-29 20:18:01 +02:00
albfan
bc1705d82c remove commented code 2015-07-29 20:18:01 +02:00
albfan
de76677bf8 manage prov type 2015-07-29 20:18:01 +02:00
albfan
756535a61d vtable callback changes
relates #35
2015-07-28 20:14:27 +02:00
albfan
b0f985069c change callback interface
resolves #30
2015-07-04 05:06:26 +02:00
albfan
544758f3d2 cleanup cmake config 2015-04-12 10:34:42 +02:00
albfan
d45cb7ef3a Merge branch 'cmake' 2015-04-11 23:31:16 +02:00
albfan
9a3a2abeab remove redundant path on include 2015-04-11 23:29:35 +02:00
albfan
8484a126be fix cmake compilation
closes #7
2015-04-11 23:11:52 +02:00
albfan
8b61f733da avoid miracle filter on wifi devices 2015-03-30 13:41:30 +02:00
albfan
640f731d44 Merge branch 'agusakov' 2015-03-30 13:40:52 +02:00
Andrey Gusakov
2fac0f0ea9 Notice sinkctl if pending peer fails to connect/disconnects
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
1a86754573 Show timeout error
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
c1b476146c RTSP: reply with only requested parameters
Some peers (like Nexus 5 and Nexus 7) send empty GET_PARAMETER
request during streaming. Seems it just some kind of ping. Do not
include unnecessary information in reply.

Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
62460a9e89 RTSP: parse SET_PARAMETER resolution
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
ca07b34f3b RTSP: support reading hex and skiping
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
c6334a7509 Allow to set resolution mask from command line
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
9be88e46bf Add WFD defines and helpers
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
0d54cd4e0b Separate go_neg_request and provision_discovery
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
563a415a24 Accept connection only on p2p_go_neg_request
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
5aa1772240 Add P2P-GO-NEG-REQUEST handler
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
6de9b112d8 Lease IP on REQUEST if address is free
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
7d936b3cdf Do not fail if host name cannot be read over DBUS
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
026e7ea095 Set Miracle as device name if no frindly_name set
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:38 +02:00
Andrey Gusakov
4d9cd01606 Do not use udev tags
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:37 +02:00
Andrey Gusakov
16d90afcd2 Remove unnecessary close body and close head
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:37 +02:00
Andrey Gusakov
066eca8638 RTSP: close message header and body on fail
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
2015-03-30 12:06:37 +02:00
albfan
cda6da3144 Allow virtual path on cmake
Remove fixed paths on CMake whom broke virtual path compilation

Relates to #7 but still not resolve it.
2015-03-22 11:25:19 +01:00
albfan
2e933497ff cmake configuration 2015-03-13 07:54:19 +01:00
albfan
f884dd858c split monolithic Makefile.am to follow autotools standards 2015-03-08 22:16:57 +01:00
Alberto Fanjul
12dbe6e335 avoid miracle filter on wifi devices 2014-09-09 12:16:12 +02:00
Alberto Fanjul
931cbea770 include stdio.h 2014-09-09 12:16:12 +02:00
Andrey Gusakov
5fc9133a60 sink: fix session ID extraction
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>
2014-09-03 08:44:40 +02:00
Andrey Gusakov
06d7dce2ec wifi: report formation failture if pending peer is lost
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>
2014-09-03 08:42:16 +02:00
Andrey Gusakov
204fa269e3 wifi: do not start new connections if one is already pending
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>
2014-09-03 08:39:08 +02:00
Andrey Gusakov
e79f08dd25 wifi: p2p_connect does not need display parameter
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>
2014-09-03 08:34:14 +02:00
Andrey Gusakov
e81f5e2833 sink: use RTSP_CODE_OK
Avoid magic numbers when creating rtsp responses, use RTSP_CODE_*
constants instead.

Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-09-03 08:11:53 +02:00
Andrey Gusakov
67ad486765 wifi: check device_name and name in supplicant_parse_peer()
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>
2014-09-03 08:11:13 +02:00
Andrey Gusakov
dbf3972619 sink: add arguments to enable/disable audio and scaling
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>
2014-09-03 08:11:13 +02:00
Andrey Gusakov
e7aa531dca sink: move GST pipeline construction to bash script
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>
2014-09-03 08:11:03 +02:00
David Herrmann
b7d04aa20d sink: exit header/body in case rtsp_message_readv() fails
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>
2014-08-15 15:53:25 +02:00
Andrey Gusakov
9b801d6b0e wifi: reformat MACs returned from DHCP
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>
2014-08-13 08:52:08 +02:00
Andrey Gusakov
e40f7f744e shared: format MAC with leading zeros
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>
2014-08-13 08:48:21 +02:00
David Herrmann
7c87510b34 dhcp: sync with gdhcp
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>
2014-08-13 08:45:15 +02:00
Andrey Gusakov
eecf576fa9 wifi: fix possible null-pointer dereference on sta_mac
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>
2014-08-13 08:30:56 +02:00
Thomas Hindoe Paaboel Andersen
f489b45f9a ctl: remove unused variables
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-08-08 15:15:43 +02:00
Andrey Gusakov
60e2254e9e ctl: save wfd_presentation_URL from M4
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>
2014-08-05 13:30:35 +02:00
Andrey Gusakov
40484a022a ctl: divide M6 (SETUP) and M7 (PLAY) stages
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>
2014-08-05 13:21:02 +02:00
David Herrmann
67de17a511 rtsp/wpas: pass va_list by reference
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>
2014-08-05 13:10:03 +02:00
Andrey Gusakov
9196c5c426 wifi: handle P2P_GROUP_FORMATION_FAILURE
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>
2014-08-05 13:02:18 +02:00
Andrey Gusakov
2a84a2d868 dbus: use 'int' instead of 'bool' in sd_bus
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>
2014-08-05 12:37:20 +02:00
Andrey Gusakov
97323d905c dbus: update to systemd API >=213
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>
2014-08-05 11:57:56 +02:00
David Herrmann
3dcb89e98b shl: update shl-macro.h
Fix a bug in SHL_ALIGN_POWER2 and add new shl_closep helpers.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-12 14:32:41 +02:00
David Herrmann
0f9ca6e7b8 build: adjust to new libsystemd-event API
The individual timer-sources were replaced by a unified timer-source.
Adjust to that.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-09 09:29:39 +02:00
David Herrmann
37c2169c9e ctl: spawn gstreamer on sink-connect
Once we have a source connection to our local sink, spawn gstreamer so the
actual video data is rendered.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-09 09:28:57 +02:00
David Herrmann
4907155317 ctl: add sinkctl
miracle-sinkctl is a very basic Miracast-Sink implementation. It is meant
for debugging and as proof-of-concept.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 15:29:46 +02:00
David Herrmann
95866f54f4 ctl: advertise wifi-connected changes after updating props
If we advertise changes in Peer.Connected _before_ updating other props,
they're not available in the callbacks. Delay the notifications after we
parsed all props.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 15:23:53 +02:00
David Herrmann
f275a60401 rtsp: strip remote-cookie during reply-matching
We need to drop the remote-cookie flag when matching replies. Otherwise,
we will never find the local request.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 15:23:17 +02:00
David Herrmann
4ea4bb7d82 wifi: parse P2P_DEVICE_FOUND immediately
If we delay device-parsing until P2P_PEER returns, we might receive other
device events in between which we cannot handle as the peer is unknown.
Avoid that by immediately creating the peer and appending more detailed
data later once P2P_PEER returns.

As P2P_PEER keys and P2P_DEVICE_FOUND keys are different (wholy shit, what
a fucking interface), we need to parse both. Lets hope there won't be any
conflicts.

WARNING: The wfd_subelements field is currently very inconsistent.
Sometimes we only use dev_info fields, somethings the whole IE. Users
shall use it as boolean value, only (set vs. unset). Once we add a proper
IE parser, we will provide more advanced fields.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 12:24:19 +02:00
David Herrmann
f6e434e86a rtsp: add rtsp bus
WifiDisplay uses RTSP for stream-setups. This adds a basic rtsp-bus
implementations that we can use for sinks and sources.

Note that the implementation is optimized for usability, not speed. RTSP
is used for control-data, not streaming-data so there's no need to
over-optimize it. In case inlined RTP is used, we still provide proper
speed, even though that's usually not used by WifiDisplay implementations
(due to the TCP requirement).

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 11:39:02 +02:00
David Herrmann
0d5b431367 ctl: make cli_bus and cli_event global
The event-loop might be needed in later ctl additions for timeouts, so
make it global. Same for the bus-logic.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 11:35:33 +02:00
David Herrmann
430d565ccc wifi: declare supplicant_set_wfd_subelements()
The declaration is missing, add it to suppress 'unknown function'
warnings.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 11:34:51 +02:00
David Herrmann
b3f4527444 ctl: suppress unused-result warnings
Use the 'v' variants of cli_vENOMEM() if the result is unused.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 11:34:17 +02:00
David Herrmann
63a0580695 wifi: send P2P_FIND on each p2p_scan() request
wpa_supplicant is horrible in notifying us about p2p-scans. During failed
connection attempts or other timeouts, we usually are not notified about
scan-stops. Therefore, a following p2p-scan will simply be ignored as we
think it's still running.

Avoid that problem by always forwarding the P2P_FIND command.
wpa_supplicant can deal with redundant requests so we're fine. Note that
this requires the caller to issue these calls in intervals or/and after
any issues wifi request. Once wpas fixes this issue, we can add this guard
again and the redundant requests will be suppressed.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 11:11:02 +02:00
David Herrmann
e2781c0a7a wifi: fix unused-result warning in log_ENOMEM()
Use log_vENOMEM() as we don't use the return-code.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-05-08 11:06:07 +02:00
David Herrmann
78cf818484 ctl: publish objects after parsing properties
Delay object-broadcasts so we first parse properties and then advertise
the objects. Otherwise, the caller will get almost empty objects which are
rather useless.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-04-23 12:30:20 +02:00
David Herrmann
d0a85ac46c ctl: parse wfd-subelements
Parse and show wfd-subelements.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-04-23 12:09:03 +02:00
David Herrmann
e624d5f81a wifi: add wfd-subelement properties
Allow dbus API users to read and modify WFD subelements.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-04-23 12:07:23 +02:00
David Herrmann
61db4a1d71 shl: fix shl_qstr_tokenize() quote parser
The parser is simply broken, fix it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-29 12:51:40 +01:00
David Herrmann
9fdda3b09a wpas: drain input-queues before signalling HUP
We _must_ aggressively drain input queues before we signal any HUP. There
might be queued messages that tell us important information about the
termination of wpa_supplicant.

Therefore, if a write() operation fails, we only signal HUP if the input
queues are empty. However, we cannot rely on EPOLLIN to be set, as the
input data might have arrived in between epoll_wait() and write(),
therefore, always run the non-blocking read() in case write() failed.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-28 12:40:17 +01:00
David Herrmann
4f55a01dc3 shl: remove custom offsetof helpers
Use the generic shl_container_of() instead of all the custom helpers.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-21 12:17:08 +01:00
David Herrmann
12bf5e026e shl: add ring-buffer helpers
The shl_ring helpers manage a dynamically-growing ring-buffer. We need
that for the following RTSP stream parsers, so add them to src/shared/.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-21 12:15:57 +01:00
David Herrmann
920f3ae250 shl: add u64 htable helpers
Add u64 helpers to shl_htable. They're fairly trivial and just copied from
unsigned-long, however, in case size_t is not 64bit wide we need to do
some trivial hashing.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-21 11:54:45 +01:00
David Herrmann
87b804c481 Remove old wifi code in miracled
The wifi code is now moved to miracle-wifid, no need to keep it anymore.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-19 13:31:01 +01:00
David Herrmann
89a268109e Remove old miraclectl
The miraclectl tool is no longer needed, remove it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-19 13:23:58 +01:00
David Herrmann
6f9ab46448 Add new miracle-wifictl program
The miracle-wifictl program can be used to manage miracle-wifid. It
provides low-level P2P helpers, so the main miraclectl can skip thos.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-19 13:10:30 +01:00
David Herrmann
18a5094bc0 Add new miracle-wifid daemon
The miracle-wifid daemon is a rewrite of the wifi-related parts of
miracled. Unlike miracled, we no longer integrate the wifi-part directly
into the core daemon. This way, we can easily replace the wifi-bridge with
other network managers once they gain P2P capabilities.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-19 13:08:25 +01:00
David Herrmann
f34face988 shared: add wpa_supplicant bus-helpers
The wpas-helpers provide easy _asynchronous_ access to wpa_supplicant
control interfaces. Compared to the old wpa_ctrl_* stuff it's no longer
synchronous. Thus, it doesn't block our daemon while wpa_supplicant runs
some heavy work again..

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-19 13:03:32 +01:00
David Herrmann
c6ac2b612a Change license to LGPL
Apply LGPL to all code that is not scheduled for removal.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-19 13:01:23 +01:00