Merge branch 'nto-signal-stats'
[dvblast.git] / comm.h
blob3cf97e21b8377bdd9e798612cd5886ca57c17a3b
1 /*****************************************************************************
2 * comm.h
3 *****************************************************************************
4 * Copyright (C) 2008 VideoLAN
6 * Authors: Christophe Massiot <massiot@via.ecp.fr>
8 * This program is free software. It comes without any warranty, to
9 * the extent permitted by applicable law. You can redistribute it
10 * and/or modify it under the terms of the Do What The Fuck You Want
11 * To Public License, Version 2, as published by Sam Hocevar. See
12 * http://sam.zoy.org/wtfpl/COPYING for more details.
13 *****************************************************************************/
15 #ifdef HAVE_DVB_SUPPORT
16 /* DVB Card Drivers */
17 #include <linux/dvb/version.h>
18 #include <linux/dvb/dmx.h>
19 #include <linux/dvb/frontend.h>
20 #include <linux/dvb/ca.h>
21 #endif
23 #include <bitstream/mpeg/psi.h>
25 #define COMM_HEADER_SIZE 8
26 #define COMM_BUFFER_SIZE (COMM_HEADER_SIZE + ((PSI_PRIVATE_MAX_SIZE + PSI_HEADER_SIZE) * PSI_TABLE_MAX_SECTIONS))
27 #define COMM_HEADER_MAGIC 0x49
29 #define COMM_MAX_MSG_CHUNK 4096
31 typedef enum {
32 CMD_INVALID = 0,
33 CMD_RELOAD = 1,
34 CMD_SHUTDOWN = 2,
35 CMD_FRONTEND_STATUS = 3,
36 CMD_MMI_STATUS = 4,
37 CMD_MMI_SLOT_STATUS = 5, /* arg: slot */
38 CMD_MMI_OPEN = 6, /* arg: slot */
39 CMD_MMI_CLOSE = 7, /* arg: slot */
40 CMD_MMI_RECV = 8, /* arg: slot */
41 CMD_GET_PAT = 10,
42 CMD_GET_CAT = 11,
43 CMD_GET_NIT = 12,
44 CMD_GET_SDT = 13,
45 CMD_GET_PMT = 14, /* arg: service_id (uint16_t) */
46 CMD_GET_PIDS = 15,
47 CMD_GET_PID = 16, /* arg: pid (uint16_t) */
48 CMD_MMI_SEND_TEXT = 17, /* arg: slot, en50221_mmi_object_t */
49 CMD_MMI_SEND_CHOICE = 18, /* arg: slot, en50221_mmi_object_t */
50 CMD_GET_EIT_PF = 19, /* arg: service_id (uint16_t) */
51 CMD_GET_EIT_SCHEDULE = 20, /* arg: service_id (uint16_t) */
52 } ctl_cmd_t;
54 typedef enum {
55 RET_OK = 0,
56 RET_ERR = 1,
57 RET_FRONTEND_STATUS = 2,
58 RET_MMI_STATUS = 3,
59 RET_MMI_SLOT_STATUS = 4,
60 RET_MMI_RECV = 5,
61 RET_MMI_WAIT = 6,
62 RET_NODATA = 7,
63 RET_PAT = 8,
64 RET_CAT = 9,
65 RET_NIT = 10,
66 RET_SDT = 11,
67 RET_PMT = 12,
68 RET_PIDS = 13,
69 RET_PID = 14,
70 RET_EIT_PF = 15,
71 RET_EIT_SCHEDULE = 16,
72 RET_HUH = 255,
73 } ctl_cmd_answer_t;
75 #ifdef HAVE_DVB_SUPPORT
76 struct ret_frontend_status
78 struct dvb_frontend_info info;
79 fe_status_t i_status;
80 uint32_t i_ber;
81 uint16_t i_strength, i_snr;
84 struct ret_mmi_status
86 ca_caps_t caps;
89 struct ret_mmi_slot_status
91 ca_slot_info_t sinfo;
94 struct ret_mmi_recv
96 en50221_mmi_object_t object;
99 struct cmd_mmi_send
101 uint8_t i_slot;
102 en50221_mmi_object_t object;
104 #endif
106 struct cmd_pid_info
108 ts_pid_info_t pids[MAX_PIDS];