mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
miracle-wfdctl: remove unused function and improve log message for
peer new & delete
This commit is contained in:
parent
750ff77929
commit
d74d36a99e
1 changed files with 14 additions and 10 deletions
|
@ -71,14 +71,6 @@ error:
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ctl_wfd_clear_sink(char **elem, void *ctx)
|
|
||||||
{
|
|
||||||
if(*elem == ctx) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
wfd_sink_free(wfd_sink_from_htable(elem));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ctl_wfd_destroy(struct ctl_wfd *wfd)
|
static void ctl_wfd_destroy(struct ctl_wfd *wfd)
|
||||||
{
|
{
|
||||||
ctl_wifi_free(wfd->wifi);
|
ctl_wifi_free(wfd->wifi);
|
||||||
|
@ -322,9 +314,13 @@ void ctl_fn_peer_new(struct ctl_peer *p)
|
||||||
union wfd_sube sube;
|
union wfd_sube sube;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
log_debug("new peer %s shows up: '%s'",
|
||||||
|
p->label,
|
||||||
|
p->wfd_subelements);
|
||||||
|
|
||||||
r = wfd_sube_parse(p->wfd_subelements, &sube);
|
r = wfd_sube_parse(p->wfd_subelements, &sube);
|
||||||
if(0 > r) {
|
if(0 > r) {
|
||||||
log_debug("invalid subelement: '%s'", p->wfd_subelements);
|
log_debug("peer %s has invalid subelement", p->label);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,13 +344,21 @@ void ctl_fn_peer_new(struct ctl_peer *p)
|
||||||
|
|
||||||
log_info("sink %s added", s->label);
|
log_info("sink %s added", s->label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(wfd_sube_device_is_source(&sube)) {
|
||||||
|
log_info("source %s ignired", p->label);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctl_fn_peer_free(struct ctl_peer *p)
|
void ctl_fn_peer_free(struct ctl_peer *p)
|
||||||
{
|
{
|
||||||
struct wfd_sink *s;
|
struct wfd_sink *s;
|
||||||
_shl_free_ char *label = NULL;
|
_shl_free_ char *label = NULL;
|
||||||
int r = ctl_wfd_remove_sink_by_label(wfd, p->label, &s);
|
int r;
|
||||||
|
|
||||||
|
log_info("peer %s down", p->label);
|
||||||
|
|
||||||
|
r = ctl_wfd_remove_sink_by_label(wfd, p->label, &s);
|
||||||
if(!r) {
|
if(!r) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue