summaryrefslogtreecommitdiff
path: root/src/devices
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/fc0013.rs22
-rw-r--r--src/devices/r820t.rs4
2 files changed, 16 insertions, 10 deletions
diff --git a/src/devices/fc0013.rs b/src/devices/fc0013.rs
index 7c64758..9eb03f4 100644
--- a/src/devices/fc0013.rs
+++ b/src/devices/fc0013.rs
@@ -1,27 +1,31 @@
use super::{Tuner, TunerInfo};
+use usb::RtlSdrDeviceHandle;
-#[allow(dead_code)]
-pub struct FC0013 {
+pub struct FC0013<'a> {
pub device: TunerInfo,
+ pub handle: &'a RtlSdrDeviceHandle,
}
-#[allow(dead_code)]
+pub const TUNER_ID: &str = "fc0013";
+
pub const TUNER_INFO: TunerInfo = TunerInfo {
- id: "fc0013",
+ id: TUNER_ID,
name: "Fitipower FC0013",
i2c_addr: 0xc6,
check_addr: 0x00,
check_val: 0xa3,
};
-#[allow(dead_code)]
-impl FC0013 {
- pub fn new() -> FC0013 {
- FC0013 { device: TUNER_INFO }
+impl<'a> FC0013<'a> {
+ pub fn new(handle: &'a RtlSdrDeviceHandle) -> FC0013<'a> {
+ FC0013 {
+ device: TUNER_INFO,
+ handle: handle,
+ }
}
}
-impl Tuner for FC0013 {
+impl<'a> Tuner for FC0013<'a> {
fn init(&self) {
println!("Init {}", self.device.name);
}
diff --git a/src/devices/r820t.rs b/src/devices/r820t.rs
index ad4720d..ec0f173 100644
--- a/src/devices/r820t.rs
+++ b/src/devices/r820t.rs
@@ -8,8 +8,10 @@ pub struct R820T<'a> {
pub handle: &'a RtlSdrDeviceHandle,
}
+pub const TUNER_ID: &str = "r820t";
+
pub const TUNER_INFO: TunerInfo = TunerInfo {
- id: "r820t",
+ id: TUNER_ID,
name: "Rafael Micro R820T",
i2c_addr: 0x34,
check_addr: 0x00,