return is;
}
+#if ENABLE_SATIP_CLIENT
+static int
+api_input_satip_discover
+ ( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
+{
+ int err = 0;
+
+ if (strcmp(op, "all"))
+ return -EINVAL;
+
+ tvhinfo("satip", "Triggered new server discovery");
+
+ pthread_mutex_lock(&global_lock);
+ satip_device_discovery_start();
+ pthread_mutex_unlock(&global_lock);
+
+ return err;
+}
+#endif
+
void api_input_init ( void )
{
static api_hook_t ah[] = {
{ "hardware/tree", ACCESS_ADMIN, api_idnode_tree, api_input_hw_tree },
+#if ENABLE_SATIP_CLIENT
+ { "hardware/satip/discover", ACCESS_ADMIN, api_input_satip_discover, NULL },
+#endif
{ NULL },
};
#include <sys/socket.h>
#endif
-static void satip_device_discovery_start( void );
-
/*
*
*/
gtimer_arm(&satip_discovery_timer, satip_discovery_timer_cb, NULL, 3600);
}
-static void
+void
satip_device_discovery_start( void )
{
gtimer_arm(&satip_discovery_timer, satip_discovery_timer_cb, NULL, 1);
#ifndef __TVH_SATIP_H__
#define __TVH_SATIP_H__
+void satip_device_discovery_start( void );
+
void satip_init( str_list_t *clients );
void satip_done( void );
#if ENABLE_V4L || ENABLE_LINUXDVB || ENABLE_SATIP_CLIENT || ENABLE_HDHOMERUN_CLIENT
{ "tvadapters", NULL },
#endif
+#if ENABLE_SATIP_CLIENT
+ { "satip_client", NULL },
+#endif
#if ENABLE_SATIP_SERVER
{ "satip_server", NULL },
#endif
handler: cleanImagecache
});
+ if (tvheadend.capabilities.indexOf('satip_client') !== -1) {
+ var satipButton = new Ext.Button({
+ text: "Discover SAT>IP servers",
+ tooltip: 'Look for new SAT>IP servers',
+ iconCls: 'find',
+ handler: satipDiscover,
+ });
+ } else {
+ var satipButton = null;
+ }
+
+
var helpButton = new Ext.Button({
text: 'Help',
iconCls: 'help',
if (imagecache_form)
_items.push(imagecache_form);
+ var _tbar = [saveButton, '-', imagecacheButton];
+ if (satipButton) {
+ _tbar.push('-');
+ _tbar.push(satipButton);
+ }
+ _tbar.push('->');
+ _tbar.push(helpButton);
+
var mpanel = new Ext.Panel({
title: 'General',
iconCls: 'general',
bodyStyle: 'padding:15px',
layout: 'form',
items: _items,
- tbar: [saveButton, '-', imagecacheButton, '->', helpButton]
+ tbar: _tbar,
});
tvheadend.paneladd(panel, mpanel, index);
function cleanImagecache() {
saveChangesImagecache({'clean': 1});
}
+
+ function satipDiscover() {
+ Ext.Ajax.request({
+ url: 'api/hardware/satip/discover',
+ params: { op: 'all' },
+ });
+ }
};