… | |
… | |
19 | |
19 | |
20 | Noteworthy differences to the C API: unions and sub-structs are usually |
20 | Noteworthy differences to the C API: unions and sub-structs are usually |
21 | translated into flat perl hashes, i.e C<struct.u.qam.symbol_rate> |
21 | translated into flat perl hashes, i.e C<struct.u.qam.symbol_rate> |
22 | becomes C<< $struct->{symbol_rate} >>. |
22 | becomes C<< $struct->{symbol_rate} >>. |
23 | |
23 | |
24 | Noteworthy limitations of this module include: no way to set the |
24 | Noteworthy limitations of this module include: No interface to the video, |
25 | frequency or diseqc. No interface to the video, audio and net devices. |
|
|
26 | If you need this functionality bug the author. |
25 | audio and net devices. If you need this functionality bug the author. |
27 | |
26 | |
28 | =cut |
27 | =cut |
29 | |
28 | |
30 | package Linux::DVB; |
29 | package Linux::DVB; |
31 | |
30 | |
32 | use Fcntl (); |
31 | use Fcntl (); |
33 | |
32 | |
34 | BEGIN { |
33 | BEGIN { |
35 | $VERSION = '0.4'; |
34 | $VERSION = '1.0'; |
36 | @ISA = qw(Exporter); |
35 | @ISA = qw(Exporter); |
37 | |
36 | |
38 | require XSLoader; |
37 | require XSLoader; |
39 | XSLoader::load __PACKAGE__, $VERSION; |
38 | XSLoader::load __PACKAGE__, $VERSION; |
40 | |
39 | |
… | |
… | |
106 | %$self = ( %$self, %{ $self->frontend_info } ); |
105 | %$self = ( %$self, %{ $self->frontend_info } ); |
107 | |
106 | |
108 | $self; |
107 | $self; |
109 | } |
108 | } |
110 | |
109 | |
111 | sub frontend_info { _frontend_info ($_[0]{fd}) } |
|
|
112 | sub status { _read_status ($_[0]{fd}) } |
|
|
113 | sub ber { _read_ber ($_[0]{fd}) } |
|
|
114 | sub snr { _snr ($_[0]{fd}) } |
|
|
115 | sub signal_strength { _signal_strength ($_[0]{fd}) } |
|
|
116 | sub uncorrected { _uncorrected ($_[0]{fd}) } |
|
|
117 | |
|
|
118 | =item $fe->set (parameter => value, ...) |
110 | =item $fe->set (parameter => value, ...) |
119 | |
111 | |
120 | Sets frontend parameters. All values are stuffed into the |
112 | Sets frontend parameters. All values are stuffed into the |
121 | C<dvb_frontend_parameters> structure without conversion and passed to |
113 | C<dvb_frontend_parameters> structure without conversion and passed to |
122 | FE_SET_FRONTEND. |
114 | FE_SET_FRONTEND. |
… | |
… | |
134 | fec_inner => |
126 | fec_inner => |
135 | |
127 | |
136 | QAM frontends: |
128 | QAM frontends: |
137 | |
129 | |
138 | symbol_rate => |
130 | symbol_rate => |
139 | fec_inner => |
|
|
140 | modulation => |
131 | modulation => |
141 | |
132 | |
142 | QFDM frontends: |
133 | QFDM frontends: |
143 | |
134 | |
144 | bandwidth => |
135 | bandwidth => |
… | |
… | |
165 | |
156 | |
166 | { |
157 | { |
167 | frequency => 426000000, # 426 Mhz |
158 | frequency => 426000000, # 426 Mhz |
168 | inversion => 0, # INVERSION_OFF |
159 | inversion => 0, # INVERSION_OFF |
169 | symbol_rate => 6900000, # 6.9 MB/s |
160 | symbol_rate => 6900000, # 6.9 MB/s |
170 | fec_inner => 0, # FEC_NONE |
|
|
171 | modulation => 3, # QAM_64 |
161 | modulation => 3, # QAM_64 |
172 | } |
162 | } |
173 | |
163 | |
174 | =cut |
164 | =cut |
175 | |
165 | |
176 | sub parameters { _get ($_[0]{fd}, $_[0]{type}) } |
166 | sub parameters { _get ($_[0]{fd}, $_[0]{type}) } |
177 | sub get { _get ($_[0]{fd}, $_[0]{type}) } # unannounced alias |
167 | sub get { _get ($_[0]{fd}, $_[0]{type}) } # unannounced alias |
178 | sub event { _event ($_[0]{fd}, $_[0]{type}) } |
168 | sub event { _event ($_[0]{fd}, $_[0]{type}) } |
|
|
169 | |
|
|
170 | =item $ok = $fe->diseqc_reset_overload |
|
|
171 | |
|
|
172 | If the bus has been automatically powered off due to power overload, this |
|
|
173 | call restores the power to the bus. The call requires read/write access |
|
|
174 | to the device. This call has no effect if the device is manually powered |
|
|
175 | off. Not all DVB adapters support this call. |
|
|
176 | |
|
|
177 | =item $ok = $fe->diseqc_voltage (13|18) |
|
|
178 | |
|
|
179 | Set the DiSEqC voltage to either 13 or 18 volts. |
|
|
180 | |
|
|
181 | =item $ok = $fe->diseqc_tone (1|0) |
|
|
182 | |
|
|
183 | Enables (1) or disables (0) the DiSEqC continuous 22khz tone generation. |
|
|
184 | |
|
|
185 | =item $ok = $fe->diseqc_send_burst (0|1) |
|
|
186 | |
|
|
187 | Sends a 22KHz tone burst of type SEC_MINI_A (0) or SEC_MINI_B (1). |
|
|
188 | |
|
|
189 | =item $ok = $fe->diseqc_cmd ($command) |
|
|
190 | |
|
|
191 | Sends a DiSEqC command. |
|
|
192 | |
|
|
193 | =item $reply = $fe->diseqc_reply ($timeout) |
|
|
194 | |
|
|
195 | Receives a reply to a DiSEqC 2.0 command (or undef). |
|
|
196 | |
|
|
197 | =cut |
179 | |
198 | |
180 | package Linux::DVB::Demux; |
199 | package Linux::DVB::Demux; |
181 | |
200 | |
182 | @ISA = qw(Linux::DVB); |
201 | @ISA = qw(Linux::DVB); |
183 | |
202 | |