mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
miracled: add udev-based link enumeration/monitor
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>
This commit is contained in:
parent
14aa8368e6
commit
3a8e2ff9e0
3 changed files with 160 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <libudev.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <systemd/sd-bus.h>
|
||||
|
@ -122,6 +123,9 @@ struct manager {
|
|||
sd_event *event;
|
||||
sd_bus *bus;
|
||||
sd_event_source *sigs[_NSIG];
|
||||
struct udev *udev;
|
||||
struct udev_monitor *udev_mon;
|
||||
sd_event_source *udev_mon_source;
|
||||
|
||||
unsigned int peer_ids;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue