Add HTSP getInfo method.
This commit is contained in:
parent
4aa1c54a8a
commit
fbe84c1145
1 changed files with 18 additions and 0 deletions
18
htsp.c
18
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},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue