From fbe84c1145d14d47540cfe034cbd660425899b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Sat, 28 Feb 2009 19:00:47 +0000 Subject: [PATCH] Add HTSP getInfo method. --- htsp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htsp.c b/htsp.c index 1b7a3bdc..be4e6cbf 100644 --- a/htsp.c +++ b/htsp.c @@ -40,6 +40,8 @@ #include +#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},