Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dbus: SAT>IP - add SAT>IP tuner notifications
  • Loading branch information
perexg committed Aug 11, 2014
1 parent 4b5da7c commit 069090e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/input/mpegts/satip/satip.c
Expand Up @@ -24,6 +24,7 @@
#include "upnp.h"
#include "settings.h"
#include "satip_private.h"
#include "dbus.h"

#include <arpa/inet.h>
#include <openssl/sha.h>
Expand All @@ -35,6 +36,25 @@

static void satip_device_discovery_start( void );

/*
*
*/

static void
satip_device_dbus_notify( satip_device_t *sd, const char *sig_name )
{
#if ENABLE_DBUS_1
char buf[256];

htsmsg_t *msg = htsmsg_create_list();
htsmsg_add_str(msg, NULL, sd->sd_info.addr);
htsmsg_add_str(msg, NULL, sd->sd_info.location);
htsmsg_add_str(msg, NULL, sd->sd_info.server);
snprintf(buf, sizeof(buf), "/input/mpegts/satip/%s", idnode_uuid_as_str(&sd->th_id));
dbus_emit_signal(buf, sig_name, msg);
#endif
}

/*
* SAT-IP client
*/
Expand Down Expand Up @@ -396,6 +416,8 @@ satip_device_create( satip_device_info_t *info )

htsmsg_destroy(conf);

satip_device_dbus_notify(sd, "start");

return sd;
}

Expand Down Expand Up @@ -458,6 +480,8 @@ satip_device_destroy( satip_device_t *sd )
while ((lfe = TAILQ_FIRST(&sd->sd_frontends)) != NULL)
satip_frontend_delete(lfe);

satip_device_dbus_notify(sd, "stop");

#define FREEM(x) free(sd->sd_info.x)
FREEM(myaddr);
FREEM(addr);
Expand Down

0 comments on commit 069090e

Please sign in to comment.