2020-10-26 13:14:35 +01:00
|
|
|
# libdvb
|
|
|
|
|
2021-01-20 13:05:25 +01:00
|
|
|
libdvb is an interface library for DVB-API v5 devices in Linux.
|
2020-10-26 13:14:35 +01:00
|
|
|
|
|
|
|
Supports three types of delivery systems:
|
|
|
|
|
|
|
|
- Satellite: DVB-S, DVB-S2
|
|
|
|
- Terretrial: DVB-T, DVB-T2, ATSC, ISDB-T
|
|
|
|
- Cable: DVB-C
|
|
|
|
|
|
|
|
TODO:
|
|
|
|
|
|
|
|
- Cenelec EN 50221 - Common Interface Specification for Conditional Access and
|
|
|
|
other Digital Video BroadcastingDecoder Applications
|
|
|
|
- DiSEqC 1.0
|
|
|
|
- DiSEqC 1.1
|
|
|
|
- EN 50494 - Unicable I
|
|
|
|
- EN 50607 - Unicable II
|
|
|
|
|
|
|
|
## FeDevice
|
|
|
|
|
|
|
|
Example DVB-S2 tune:
|
|
|
|
|
2021-01-20 13:31:42 +01:00
|
|
|
```rust
|
2020-10-26 13:14:35 +01:00
|
|
|
let cmdseq = vec![
|
|
|
|
DtvProperty::new(DTV_DELIVERY_SYSTEM, SYS_DVBS2),
|
|
|
|
DtvProperty::new(DTV_FREQUENCY, (11044 - 9750) * 1000),
|
|
|
|
DtvProperty::new(DTV_MODULATION, PSK_8),
|
|
|
|
DtvProperty::new(DTV_VOLTAGE, SEC_VOLTAGE_13),
|
|
|
|
DtvProperty::new(DTV_TONE, SEC_TONE_OFF),
|
|
|
|
DtvProperty::new(DTV_INVERSION, INVERSION_AUTO),
|
|
|
|
DtvProperty::new(DTV_SYMBOL_RATE, 27500 * 1000),
|
|
|
|
DtvProperty::new(DTV_INNER_FEC, FEC_AUTO),
|
|
|
|
DtvProperty::new(DTV_PILOT, PILOT_AUTO),
|
|
|
|
DtvProperty::new(DTV_ROLLOFF, ROLLOFF_35),
|
|
|
|
DtvProperty::new(DTV_TUNE, 0),
|
|
|
|
];
|
|
|
|
|
2021-01-22 00:31:55 +01:00
|
|
|
let fe = FeDevice::open_rw("/dev/dvb/adapter0/frontend0")?;
|
2021-01-26 14:17:59 +01:00
|
|
|
fe.set_properties(&cmdseq)?;
|
2020-10-26 13:14:35 +01:00
|
|
|
```
|
2021-01-20 13:31:42 +01:00
|
|
|
|
|
|
|
Frontend information:
|
|
|
|
|
|
|
|
```rust
|
2021-01-22 00:31:55 +01:00
|
|
|
let fe = FeDevice::open_rd("/dev/dvb/adapter0/frontend0")?;
|
2021-01-20 13:31:42 +01:00
|
|
|
println!("{}", &fe);
|
|
|
|
```
|
|
|
|
|
|
|
|
Frontend status:
|
|
|
|
|
|
|
|
```rust
|
2021-01-22 00:31:55 +01:00
|
|
|
let fe = FeDevice::open_rd("/dev/dvb/adapter0/frontend0")?;
|
2021-01-20 13:31:42 +01:00
|
|
|
let mut status = FeStatus::default();
|
|
|
|
status.read(&fe)?;
|
2021-01-29 19:29:19 +01:00
|
|
|
println!("{}", &status);
|
2021-01-20 13:31:42 +01:00
|
|
|
```
|