]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add HTSP getInfo method.
authorAndreas Öman <andreas@lonelycoder.com>
Sat, 28 Feb 2009 19:00:47 +0000 (19:00 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sat, 28 Feb 2009 19:00:47 +0000 (19:00 +0000)
htsp.c

diff --git a/htsp.c b/htsp.c
index 1b7a3bdc641714f02cbe32542e43171e550a8d54..be4e6cbf97bbb84ccfeb564d278af5bc9385d09e 100644 (file)
--- a/htsp.c
+++ b/htsp.c
@@ -40,6 +40,8 @@
 
 #include <libhts/htsmsg_binary.h>
 
+#define HTSP_PROTO_VERSION 1
+
 extern const char *htsversion;
 
 LIST_HEAD(htsp_connection_list, htsp_connection);
@@ -535,6 +537,21 @@ htsp_method_authenticate(htsp_connection_t *htsp, htsmsg_t *in)
 
 
 
+/**
+ * Request various info about tvheadend
+ */
+static htsmsg_t *
+htsp_method_getInfo(htsp_connection_t *htsp, htsmsg_t *in)
+{
+  extern const char *htsversion;
+  htsmsg_t *r = htsmsg_create();
+
+  htsmsg_add_u32(r, "protover", HTSP_PROTO_VERSION);
+  htsmsg_add_str(r, "appver", htsversion);
+
+  return r;
+}
+
 
 /**
  * HTSP methods
@@ -548,6 +565,7 @@ struct {
   { "authenticate", htsp_method_authenticate, 0},
   { "enableAsyncMetadata", htsp_method_async, ACCESS_STREAMING},
   { "getEvent", htsp_method_getEvent, ACCESS_STREAMING},
+  { "getInfo", htsp_method_getInfo, ACCESS_STREAMING},
   { "subscribe", htsp_method_subscribe, ACCESS_STREAMING},
   { "unsubscribe", htsp_method_unsubscribe, ACCESS_STREAMING},