aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/lowlevel/mhw.h
blob: f06c86e897b317044d9f336c536d8ccdcc37025c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef __MHW_H__
#define __MHW_H__

#include <sys/types.h>

/* Structures for MHW-EPG tables parsing */

typedef struct {
   u_char	network_id_hi;
   u_char	network_id_lo;
   u_char	transport_stream_id_hi;
   u_char	transport_stream_id_lo;
   u_char	channel_id_hi;
   u_char	channel_id_lo;
   u_char	name[16];
} mhw_channel_name_t;

typedef struct {
   u_char	name[15];
} mhw_theme_name_t;

struct summary_min {
#if BYTE_ORDER == BIG_ENDIAN
   u_char minutes                                :6;
   u_char                                        :1;
   u_char summary_available                      :1;
#else
   u_char summary_available                      :1;
   u_char                                        :1;
   u_char minutes                                :6;
#endif
};

struct day_hours {
#if BYTE_ORDER == BIG_ENDIAN
   u_char day                                    :3;
   u_char hours                                  :5;
#else
   u_char hours                                  :5;
   u_char day                                    :3;
#endif
};

typedef struct {
   u_char table_id                               :8;
#if BYTE_ORDER == BIG_ENDIAN
   u_char section_syntax_indicator               :1;
   u_char dummy                                  :1;
   u_char                                        :2;
   u_char section_length_hi                      :4;
#else
   u_char section_length_hi                      :4;
   u_char                                        :2;
   u_char dummy                                  :1;
   u_char section_syntax_indicator               :1;
#endif
   u_char section_length_lo                      :8;
   u_char channel_id                             :8;
   union {
     u_char theme_id                             :8;
     u_char mhw2_hours                           :8;
   };
   union {
     struct day_hours dh;
     u_char mhw2_minutes                         :8;
   };
   union {
     struct summary_min ms;
     u_char mhw2_seconds                         :8;
   };
   u_char                                        :8; // mhw2_title begin
   u_char                                        :8;
   u_char duration_hi                            :8;
   u_char duration_lo                            :8;
   u_char title                                [23];
   u_char ppv_id_hi                              :8;
   u_char ppv_id_mh                              :8;
   u_char ppv_id_ml                              :8;
   u_char ppv_id_lo                              :8;
   u_char program_id_hi                          :8;
   u_char program_id_mh                          :8;
   u_char program_id_ml                          :8;
   u_char program_id_lo                          :8; // mhw2_title end (35chars max)
   u_char mhw2_mjd_hi                            :8;
   u_char mhw2_mjd_lo                            :8;
   u_char mhw2_duration_hi                       :8;
   u_char mhw2_duration_lo                       :8;
} mhw_title_t;

typedef struct mhw_summary {
   u_char table_id                               :8;
#if BYTE_ORDER == BIG_ENDIAN
   u_char section_syntax_indicator               :1;
   u_char dummy                                  :1;
   u_char                                        :2;
   u_char section_length_hi                      :4;
#else
   u_char section_length_hi                      :4;
   u_char                                        :2;
   u_char dummy                                  :1;
   u_char section_syntax_indicator               :1;
#endif
   u_char section_length_lo                      :8;
   u_char program_id_hi                          :8;
   u_char program_id_mh                          :8;
   u_char program_id_ml                          :8;
   u_char program_id_lo                          :8;
   u_char                                        :8;
   u_char                                        :8;
   u_char                                        :8;
   u_char nb_replays                             :8;
} mhw_summary_t;

#endif